예제 #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);
        }