예제 #1
0
파일: World.cs 프로젝트: Timothep/Cells.net
        /// <summary>
        /// 
        /// </summary>
        /// <param name="spawnLife"></param>
        /// <param name="cell"></param>
        public void CreateSpawns(short spawnLife, Cell cell)
        {
            // We don't create spawns at the same place
            ICoordinates positionSpawn = new Coordinates();
            positionSpawn.X = cell.Position.X;
            positionSpawn.Y = cell.Position.Y;

            if (Helper.CoordinatesAreValid((Int16)(positionSpawn.X + 1), positionSpawn.Y))
                positionSpawn.X += 1;
            else
                positionSpawn.X += -1;

            this.CreateCell(cell.GetAttachedBrainType(), cell.GetTeamQualifier(), spawnLife, cell.Position);
            this.CreateCell(cell.GetAttachedBrainType(), cell.GetTeamQualifier(), spawnLife, positionSpawn);
        }
예제 #2
0
파일: World.cs 프로젝트: Timothep/Cells.net
 /// <summary>
 /// Commit removal of the current cell from the game
 /// </summary>
 /// <param name="deadCell"></param>
 private void RejectCell(Cell deadCell)
 {
     this.cells.Remove(deadCell);
     this.masterMap.RemoveCell(deadCell);
     this.displayController.SetBackgroundToBePaintAt(deadCell.Position);
 }