예제 #1
0
        /// <summary>
        /// Gets the maze of the location
        /// </summary>
        /// <param name="dungeon">Dungeon handle</param>
        /// <returns>Maze handle or null</returns>
        public Maze GetMaze(Dungeon dungeon)
        {
            if (dungeon == null)
            {
                return(null);
            }

            return(dungeon.GetMaze(Maze));
        }
예제 #2
0
        /// <summary>
        /// Gets the square
        /// </summary>
        /// <param name="dungeon">Dungeon handle</param>
        /// <returns>Square handle or null</returns>
        public Square GetSquare(Dungeon dungeon)
        {
            if (dungeon == null)
            {
                return(null);
            }

            Maze maze = dungeon.GetMaze(Maze);

            if (maze == null)
            {
                return(null);
            }

            return(maze.GetSquare(Coordinate));
        }
예제 #3
0
        /// <summary>
        /// Teleport the team to a new location, but don't change direction
        /// </summary>
        /// <param name="location">Location in the dungeon</param>
        /// <returns>True if teleportion is ok, or false if M. Spoke failed !</returns>
        public bool Teleport(DungeonLocation location, Dungeon dungeon)
        {
            if (dungeon == null || location == null)
            {
                return(false);
            }

            // Destination maze
            Maze maze = dungeon.GetMaze(location.Maze);

            if (maze == null)
            {
                return(false);
            }

            Maze = maze;

            // Leave current square
            if (Square != null)
            {
                Square.OnTeamLeave();
            }

            // Change location
            Location.Coordinate = location.Coordinate;
            Location.Maze       = Maze.Name;
            Location.Direction  = location.Direction;


            // New block
            Square = Maze.GetSquare(location.Coordinate);

            // Enter new block
            Square.OnTeamEnter();

            return(true);
        }
예제 #4
0
		/// <summary>
		/// Gets the square
		/// </summary>
		/// <param name="dungeon">Dungeon handle</param>
		/// <returns>Square handle or null</returns>
		public Square GetSquare(Dungeon dungeon)
		{
			if (dungeon == null)
				return null;

			Maze maze = dungeon.GetMaze(Maze);
			if (maze == null)
				return null;

			return maze.GetSquare(Coordinate);
		}
예제 #5
0
		/// <summary>
		/// Gets the maze of the location
		/// </summary>
		/// <param name="dungeon">Dungeon handle</param>
		/// <returns>Maze handle or null</returns>
		public Maze GetMaze(Dungeon dungeon)
		{
			if (dungeon == null)
				return null;

			return dungeon.GetMaze(Maze);
		}
예제 #6
0
		/// <summary>
		/// Teleport the team to a new location, but don't change direction
		/// </summary>
		/// <param name="location">Location in the dungeon</param>
		/// <returns>True if teleportion is ok, or false if M. Spoke failed !</returns>
		public bool Teleport(DungeonLocation location, Dungeon dungeon)
		{
			if (dungeon == null || location == null)
				return false;

			// Destination maze
			Maze maze = dungeon.GetMaze(location.Maze);
			if (maze == null)
				return false;

			Maze = maze;

			// Leave current square
			if (Square != null)
				Square.OnTeamLeave();

			// Change location
			Location.Coordinate = location.Coordinate;
			Location.Maze = Maze.Name;
			Location.Direction = location.Direction;


			// New block
			Square = Maze.GetSquare(location.Coordinate);

			// Enter new block
			Square.OnTeamEnter();

			return true;
		}