Пример #1
0
        /// <summary>
        /// Places a newly revived ghost
        /// </summary>
        /// <param name="ghost">
        /// Ghost to be placed
        /// </param>
        /// <param name="board">
        /// Game board
        /// </param>
        public void PlaceGhost(Cell ghost, Board board)
        {
            Position newPos;

            // x,y position of type Position
            newPos = GetPosition();

            // Change ghost to that position
            ghost.Position = newPos;

            // Add new ghost to playerGhosts array
            PlayerGhosts.Add(ghost);
        }
Пример #2
0
        /// <summary>
        /// Resurrects a ghost that is currently in the dungeon
        /// </summary>
        /// <returns>
        /// Returns the ghost that is being revived
        /// </returns>
        public Cell RessurectGhost()
        {
            int  ghostToRessurect;
            Cell ghost;

            Console.WriteLine("Pick a ghost from the Dungeon " +
                              "(select it's number): ");

            ghostToRessurect = PickAction(Dungeon.Count);
            ghost            = Dungeon[ghostToRessurect];

            PlayerGhosts.Add(Dungeon[ghostToRessurect]);
            Dungeon.Remove(Dungeon[ghostToRessurect]);

            return(ghost);
        }