Exemple #1
0
        /// <summary>
        /// Creates a new wall at the specified tile.
        /// </summary>
        /// <param name="tile">The tile to create a wall at.</param>
        /// <returns>True if the wall was created successfully.</returns>
        public bool CreateWall(Tile tile)
        {
            if (!tile.IsPlaceable)
            {
                return(false);
            }

            Wall wall = new Wall(texture)
            {
                Scene    = Scene,
                Position = tile.Position,
            };

            walls.Add(tile, wall);
            wall.OnAddedToScene();

            wall.Destroyed += (attackable) => RemoveWall(tile);

            WallAdded?.Invoke(wall);

            return(true);
        }
Exemple #2
0
 private void OnWallAdded(WallAddedEventArgs e)
 {
     WallAdded?.Invoke(SourceGrid, e);
 }