Example #1
0
        /// <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);
        }
Example #2
0
 /// <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);
 }