/// <summary> /// Constructor for clonning /// </summary> /// <param name="cell"><see cref="Cell"/> for clonning</param> public Cell(Cell cell) { _x = cell.X; _y = cell.Y; _status = cell.Status; _cellOrganism = cell.Organism; }
/// <summary> /// Set migration of organism /// </summary> /// <param name="organism"><see cref="Organism"/></param> public void SetMigration(Organism organism) { _status = OrganismStatus.Live; if (_cellOrganism == null) { _cellOrganism = organism; } else { throw new Exception("Migration to full occupied cell"); } }
/// <summary> /// Setter of cell status /// </summary> /// <param name="status"><see cref="OrganismStatus"/></param> public void SetCellStatus(OrganismStatus status) { _status = status; switch (status) { case OrganismStatus.Born: OrganismBorn(); break; case OrganismStatus.Live: OrganismLive(); break; case OrganismStatus.Dead: OrganismDead(); break; case OrganismStatus.Empty: CellEmpty(); break; case OrganismStatus.Create: OrganismCreate(); break; } }