// Path: src/com/sproutlife/model/GameClock.java
// public class GameClock {
//     private int time;
// 
//     public GameClock() {
//         time = 0;
//     }
// 
//     public int getTime() {
//         return time;
//     }
// 
//     void increment() {
//         time++;
//     }
// 
//     void reset() {
//         this.time = 0;
//     }
// }
// 
// Path: src/com/sproutlife/model/seed/Seed.java
// public class Seed {
//     
//     protected SeedSproutPattern pattern;       
//     public Point position = null;    
//     public Rotation rotation;    
//     public int seedBorder = 1;   
//     public Point parentPosition;
//     //Organism organism;   
// 
//     public Seed(SeedSproutPattern pattern, Rotation r) {    
//         this.pattern = pattern;
//         this.rotation = r;
//     }      
//     
//     public Seed(SeedSproutPattern pattern) {
//         this(pattern, Rotations.get());
//     }
//      
//     public Rotation getRotation() {
//         return rotation;
//     }
//     
//     public Point getPosition() {        
//         return position;        
//     }
//     
//     public void setPosition(int x, int y) {
//         this.position = new Point(x,y);
//     }                  
//     
//     public int getSeedBorder() {
//         return seedBorder;
//     }
//     
//     public void setSeedBorder(int b) {
//         this.seedBorder = b;
//     }
//     
//     public Point getParentPosition() {
//         return parentPosition;
//     }
//     
//     public void setParentPosition(Point parentPosition) {
//         this.parentPosition = parentPosition;
//     }
//     /*
//     public Organism getOrganism() {
//         return organism;
//     }
//     
//     public void setOrganism(Organism organism) {
//         this.organism = organism;
//     }
//     */
//     
//     public SeedSproutPattern getSeedSproutPattern() {
//         return pattern;
//     }
//     
//     public BitPattern getSeedPattern() {
//         return pattern.getSeedPattern();
//     }
//     
//     public BitPattern getSproutPattern() {
//         return pattern.getSproutPattern();
//     }       
//     
//     public boolean getSeedBit(int x, int y) {       
//         return getSeedPattern().getBit(x, y, getRotation());
//     }
//     
//     public boolean getSproutBit(int x, int y) {       
//         return getSproutPattern().getBit(x, y, getRotation());
//     }
//      
//     public int getSeedWidth() {
//         return getSeedPattern().getWidth(getRotation());
//     }
//     
//     public int getSeedHeight() {
//         return getSeedPattern().getHeight(getRotation());
//     }
//         
//     public int getSproutWidth() {
//         return getSproutPattern().getWidth(getRotation());
//     }
//         
//     public int getSproutHeight() {
//         return getSproutPattern().getHeight(getRotation());
//     }
//         
//     public Point getSproutOffset() {
//         return Rotations.offsetToBoard(
//                 pattern.getSproutOffset(), 
//                 getSeedPattern(), 
//                 getSproutPattern(), 
//                 getRotation());
//     }
//     
//     public Point getSproutPosition() {
//         Point sproutOffset = getSproutOffset();
//         return new Point(position.x + sproutOffset.x, position.y + sproutOffset.y);
//     }
//     
//     public Point getSproutCenter() {        
//         Point sproutPosition = getSproutPosition();
//         Point sproutCenter = getSproutPattern().getCenter(getRotation());       
// 
//         int ssX = sproutPosition.x+sproutCenter.x;
//         int ssY = sproutPosition.y+sproutCenter.y;
//         
//         return new Point(ssX, ssY);        
//     }
//     
//     public Point getSeedOnBit() {
//         return pattern.getSeedPattern().getOnBit(getRotation());
//     }
//     
//     public Point getSeedOnPosition() {
//         Point pos = this.getPosition();
//         Point onOffset = this.getSeedOnBit();        
//         return new Point(pos.x+onOffset.x,pos.y+onOffset.y);
//     }
// }


import java.awt.Point;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import com.sproutlife.model.GameClock;
import com.sproutlife.model.seed.Seed;
/*******************************************************************************
 * Copyright (c) 2016 Alex Shapiro - github.com/shpralex
 * This program and the accompanying materials
 * are made available under the terms of the The MIT License (MIT)
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *******************************************************************************/
package com.sproutlife.model.echosystem;



/**
 * Organisms are a collection of Cells. They keep track of the location where
 * they were born, the seed from which they sprouted, their parents and
 * children. They have a genome which stores their mutations.
 * 
 * Organisms have a lot going on, and some experimental attributes are placed in
 * OrgAttributes to keep the code a bit cleaner.
 * 
 * @author Alex Shapiro
 */

public class Organism {
    private int id;
    private ArrayList<Cell> cells;
    private Organism parent;
    private ArrayList<Organism> children;
    private Genome genome;
    private Seed seed;

    //The clock lets us know the organism's age, so we can just track when it was born 
// Path: src/com/sproutlife/model/GameClock.java
// public class GameClock {
//     private int time;
// 
//     public GameClock() {
//         time = 0;
//     }
// 
//     public int getTime() {
//         return time;
//     }
// 
//     void increment() {
//         time++;
//     }
// 
//     void reset() {
//         this.time = 0;
//     }
// }
// 
// Path: src/com/sproutlife/model/seed/Seed.java
// public class Seed {
//     
//     protected SeedSproutPattern pattern;       
//     public Point position = null;    
//     public Rotation rotation;    
//     public int seedBorder = 1;   
//     public Point parentPosition;
//     //Organism organism;   
// 
//     public Seed(SeedSproutPattern pattern, Rotation r) {    
//         this.pattern = pattern;
//         this.rotation = r;
//     }      
//     
//     public Seed(SeedSproutPattern pattern) {
//         this(pattern, Rotations.get());
//     }
//      
//     public Rotation getRotation() {
//         return rotation;
//     }
//     
//     public Point getPosition() {        
//         return position;        
//     }
//     
//     public void setPosition(int x, int y) {
//         this.position = new Point(x,y);
//     }                  
//     
//     public int getSeedBorder() {
//         return seedBorder;
//     }
//     
//     public void setSeedBorder(int b) {
//         this.seedBorder = b;
//     }
//     
//     public Point getParentPosition() {
//         return parentPosition;
//     }
//     
//     public void setParentPosition(Point parentPosition) {
//         this.parentPosition = parentPosition;
//     }
//     /*
//     public Organism getOrganism() {
//         return organism;
//     }
//     
//     public void setOrganism(Organism organism) {
//         this.organism = organism;
//     }
//     */
//     
//     public SeedSproutPattern getSeedSproutPattern() {
//         return pattern;
//     }
//     
//     public BitPattern getSeedPattern() {
//         return pattern.getSeedPattern();
//     }
//     
//     public BitPattern getSproutPattern() {
//         return pattern.getSproutPattern();
//     }       
//     
//     public boolean getSeedBit(int x, int y) {       
//         return getSeedPattern().getBit(x, y, getRotation());
//     }
//     
//     public boolean getSproutBit(int x, int y) {       
//         return getSproutPattern().getBit(x, y, getRotation());
//     }
//      
//     public int getSeedWidth() {
//         return getSeedPattern().getWidth(getRotation());
//     }
//     
//     public int getSeedHeight() {
//         return getSeedPattern().getHeight(getRotation());
//     }
//         
//     public int getSproutWidth() {
//         return getSproutPattern().getWidth(getRotation());
//     }
//         
//     public int getSproutHeight() {
//         return getSproutPattern().getHeight(getRotation());
//     }
//         
//     public Point getSproutOffset() {
//         return Rotations.offsetToBoard(
//                 pattern.getSproutOffset(), 
//                 getSeedPattern(), 
//                 getSproutPattern(), 
//                 getRotation());
//     }
//     
//     public Point getSproutPosition() {
//         Point sproutOffset = getSproutOffset();
//         return new Point(position.x + sproutOffset.x, position.y + sproutOffset.y);
//     }
//     
//     public Point getSproutCenter() {        
//         Point sproutPosition = getSproutPosition();
//         Point sproutCenter = getSproutPattern().getCenter(getRotation());       
// 
//         int ssX = sproutPosition.x+sproutCenter.x;
//         int ssY = sproutPosition.y+sproutCenter.y;
//         
//         return new Point(ssX, ssY);        
//     }
//     
//     public Point getSeedOnBit() {
//         return pattern.getSeedPattern().getOnBit(getRotation());
//     }
//     
//     public Point getSeedOnPosition() {
//         Point pos = this.getPosition();
//         Point onOffset = this.getSeedOnBit();        
//         return new Point(pos.x+onOffset.x,pos.y+onOffset.y);
//     }
// }


// Path: src/com/sproutlife/model/echosystem/Organism.java
import java.awt.Point;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import com.sproutlife.model.GameClock;
import com.sproutlife.model.seed.Seed;

/*******************************************************************************
 * Copyright (c) 2016 Alex Shapiro - github.com/shpralex
 * This program and the accompanying materials
 * are made available under the terms of the The MIT License (MIT)
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *******************************************************************************/
package com.sproutlife.model.echosystem;



/**
 * Organisms are a collection of Cells. They keep track of the location where
 * they were born, the seed from which they sprouted, their parents and
 * children. They have a genome which stores their mutations.
 * 
 * Organisms have a lot going on, and some experimental attributes are placed in
 * OrgAttributes to keep the code a bit cleaner.
 * 
 * @author Alex Shapiro
 */

public class Organism {
    private int id;
    private ArrayList<Cell> cells;
    private Organism parent;
    private ArrayList<Organism> children;
    private Genome genome;
    private Seed seed;

    //The clock lets us know the organism's age, so we can just track when it was born 
    public GameClock clock;