2
0
Эх сурвалжийг харах

RPG - UI Tweaks and more asset loading functionality added.

CartBlanche 1 сар өмнө
parent
commit
805073d57c

+ 4 - 20
RolePlayingGame/Core/GameScreens/InventoryScreen.cs

@@ -31,17 +31,11 @@ namespace RolePlaying
         protected string quantityColumnText = "Qty";
         private const int quantityColumnInterval = 450;
 
-
-
-
-
-
         /// <summary>
         /// If true, the menu is only displaying items; otherwise, only equipment.
         /// </summary>
         protected bool isItems;
 
-
         /// <summary>
         /// Retrieve the list of gear shown in this menu.
         /// </summary>
@@ -92,11 +86,6 @@ namespace RolePlaying
             return dataList.AsReadOnly();
         }
 
-
-
-
-
-
         /// <summary>
         /// Constructs a new InventoryScreen object.
         /// </summary>
@@ -114,11 +103,6 @@ namespace RolePlaying
             ResetTriggerText();
         }
 
-
-
-
-
-
         /// <summary>
         /// Delegate for item-selection events.
         /// </summary>
@@ -249,12 +233,14 @@ namespace RolePlaying
             {
                 if (isItems)
                 {
+                    titleText = "Equipment";
                     leftTriggerText = "Statistics";
-                    rightTriggerText = "Equipment";
+                    rightTriggerText = "Inventory";
                 }
                 else
                 {
-                    leftTriggerText = "Inventory";
+                    titleText = "Inventory";
+                    leftTriggerText = "Equipment";
                     rightTriggerText = "Quests";
                 }
             }
@@ -403,7 +389,5 @@ namespace RolePlaying
                     Fonts.CaptionColor);
             }
         }
-
-
     }
 }

+ 6 - 42
RolePlayingGame/Core/GameScreens/SpellbookScreen.cs

@@ -20,16 +20,9 @@ namespace RolePlaying
     /// </summary>
     class SpellbookScreen : ListScreen<Spell>
     {
-
-
         private readonly Vector2 spellDescriptionPosition = new Vector2(200, 550);
         private readonly Vector2 warningMessagePosition = new Vector2(200, 580);
 
-
-
-
-
-
         private string nameColumnText = "Name";
         private const int nameColumnInterval = 80;
 
@@ -42,17 +35,11 @@ namespace RolePlaying
         private string magicCostColumnText = "MP";
         private const int magicCostColumnInterval = 380;
 
-
-
-
-
-
         /// <summary>
         /// The FightingCharacter object whose spells are displayed.
         /// </summary>
         private FightingCharacter fightingCharacter;
 
-
         /// <summary>
         /// The statistics of the character, for calculating the eligibility of spells.
         /// </summary>
@@ -61,7 +48,6 @@ namespace RolePlaying
         /// </remarks>
         private StatisticsValue statistics;
 
-
         /// <summary>
         /// Get the list that this screen displays.
         /// </summary>
@@ -70,11 +56,6 @@ namespace RolePlaying
             return fightingCharacter.Spells.AsReadOnly();
         }
 
-
-
-
-
-
         /// <summary>
         /// Creates a new SpellbookScreen object for the given player and statistics.
         /// </summary>
@@ -92,7 +73,7 @@ namespace RolePlaying
 
             // sort the player's spell
             this.fightingCharacter.Spells.Sort(
-                delegate(Spell spell1, Spell spell2)
+                delegate (Spell spell1, Spell spell2)
                 {
                     // handle null values
                     if (spell1 == null)
@@ -118,17 +99,11 @@ namespace RolePlaying
             rightTriggerText = String.Empty;
         }
 
-
-
-
-
-
         /// <summary>
         /// Delegate for spell-selection events.
         /// </summary>
         public delegate void SpellSelectedHandler(Spell spell);
 
-
         /// <summary>
         /// Responds when an spell is selected by this menu.
         /// </summary>
@@ -138,7 +113,6 @@ namespace RolePlaying
         /// </remarks>
         public event SpellSelectedHandler SpellSelected;
 
-
         /// <summary>
         /// Respond to the triggering of the Select action (and related key).
         /// </summary>
@@ -165,7 +139,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// Returns true if the specified spell can be selected.
         /// </summary>
@@ -180,11 +153,6 @@ namespace RolePlaying
                 (!entry.IsOffensive || CombatEngine.IsActive);
         }
 
-
-
-
-
-
         /// <summary>
         /// Draw the spell at the given position in the list.
         /// </summary>
@@ -214,9 +182,9 @@ namespace RolePlaying
 
             // draw the level
             drawPosition.X += levelColumnInterval;
-            spriteBatch.DrawString(Fonts.GearInfoFont, entry.Level.ToString(), 
+            spriteBatch.DrawString(Fonts.GearInfoFont, entry.Level.ToString(),
                 drawPosition, color);
-            
+
             // draw the power
             drawPosition.X += powerColumnInterval;
             string powerText = entry.GetPowerText();
@@ -239,7 +207,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// Draw the description of the selected item.
         /// </summary>
@@ -264,12 +231,11 @@ namespace RolePlaying
             }
 
             // draw the description
-            spriteBatch.DrawString(Fonts.DescriptionFont, 
-                Fonts.BreakTextIntoLines(entry.Description, 90, 3), 
+            spriteBatch.DrawString(Fonts.DescriptionFont,
+                Fonts.BreakTextIntoLines(entry.Description, 90, 3),
                 spellDescriptionPosition, Fonts.DescriptionColor);
         }
 
-
         /// <summary>
         /// Draw the column headers above the list.
         /// </summary>
@@ -306,7 +272,5 @@ namespace RolePlaying
                     Fonts.CaptionColor);
             }
         }
-
-
     }
-}
+}

+ 14 - 55
RolePlayingGame/Core/GameScreens/StatisticsScreen.cs

@@ -22,9 +22,6 @@ namespace RolePlaying
         /// </summary>
         private Player player;
 
-
-
-
         private Texture2D statisticsScreen;
         private Texture2D selectButton;
         private Texture2D backButton;
@@ -43,23 +40,18 @@ namespace RolePlaying
         private int playerIndex = 0;
         private AnimatingSprite screenAnimation;
 
-
-
-
-
-
         private readonly Vector2 playerTextPosition = new Vector2(515, 200);
         private Vector2 currentTextPosition;
         private readonly Vector2 scoreBoardPosition = new Vector2(1160, 354);
         private Vector2 placeTextMid;
         private Vector2 statisticsNamePosition;
         private readonly Vector2 shieldPosition = new Vector2(1124, 253);
-        private readonly Vector2 idlePortraitPosition = new Vector2(300f, 380f);
+        private readonly Vector2 idlePortraitPosition = new Vector2(300f, 400f);
         private readonly Vector2 dropButtonPosition = new Vector2(900, 640);
         private readonly Vector2 statisticsBorderPosition = new Vector2(180, 147);
         private readonly Vector2 borderLinePosition = new Vector2(184, 523);
-        private readonly Vector2 characterNamePosition = new Vector2(330, 180);
-        private readonly Vector2 classNamePosition = new Vector2(330, 465);
+        private readonly Vector2 characterNamePosition = new Vector2(330, 188);
+        private readonly Vector2 classNamePosition = new Vector2(330, 460);
         private Vector2 plankPosition;
         private readonly Vector2 goldIconPosition = new Vector2(490, 640);
         private readonly Vector2 weaponPosition = new Vector2(790, 220);
@@ -72,17 +64,11 @@ namespace RolePlaying
         private readonly Vector2 backButtonPosition = new Vector2(80, 640);
         private readonly Vector2 goldPosition = new Vector2(565, 648);
 
-
-
-
-
-
         /// <summary>
         /// Creates a new StatisticsScreen object for the first party member.
         /// </summary>
         public StatisticsScreen() : this(Session.Party.Players[0]) { }
 
-
         /// <summary>
         /// Creates a new StatisticsScreen object for the given player.
         /// </summary>
@@ -101,7 +87,6 @@ namespace RolePlaying
             screenAnimation.PlayAnimation(0);
         }
 
-
         /// <summary>
         /// Loads graphics content from the content manager.
         /// </summary>
@@ -146,11 +131,6 @@ namespace RolePlaying
             plankPosition.Y = 67f;
         }
 
-
-
-
-
-
         /// <summary>
         /// Handle user input.
         /// </summary>
@@ -203,13 +183,11 @@ namespace RolePlaying
                     {
                         player = newPlayer;
                         screenAnimation = new AnimatingSprite();
-                        screenAnimation.FrameDimensions =
-                            player.MapSprite.FrameDimensions;
+                        screenAnimation.FrameDimensions = player.MapSprite.FrameDimensions;
                         screenAnimation.FramesPerRow = player.MapSprite.FramesPerRow;
                         screenAnimation.SourceOffset = player.MapSprite.SourceOffset;
                         screenAnimation.Texture = player.MapSprite.Texture;
-                        screenAnimation.AddAnimation(
-                            new Animation("Idle", 43, 48, 150, true));
+                        screenAnimation.AddAnimation(new Animation("Idle", 43, 48, 150, true));
                         screenAnimation.PlayAnimation(0);
                     }
                 }
@@ -226,38 +204,29 @@ namespace RolePlaying
                     {
                         player = newPlayer;
                         screenAnimation = new AnimatingSprite();
-                        screenAnimation.FrameDimensions =
-                            player.MapSprite.FrameDimensions;
+                        screenAnimation.FrameDimensions = player.MapSprite.FrameDimensions;
                         screenAnimation.FramesPerRow = player.MapSprite.FramesPerRow;
                         screenAnimation.SourceOffset = player.MapSprite.SourceOffset;
                         screenAnimation.Texture = player.MapSprite.Texture;
-                        screenAnimation.AddAnimation(
-                            new Animation("Idle", 43, 48, 150, true));
+                        screenAnimation.AddAnimation(new Animation("Idle", 43, 48, 150, true));
                         screenAnimation.PlayAnimation(0);
                     }
                 }
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// Draws the screen.
         /// </summary>
         public override void Draw(GameTime gameTime)
         {
-            screenAnimation.UpdateAnimation(
-                (float)gameTime.ElapsedGameTime.TotalSeconds);
+            screenAnimation.UpdateAnimation((float)gameTime.ElapsedGameTime.TotalSeconds);
 
             ScreenManager.SpriteBatch.Begin();
             DrawStatistics();
             ScreenManager.SpriteBatch.End();
         }
 
-
         /// <summary>
         /// Draws the player statistics.
         /// </summary>
@@ -286,7 +255,6 @@ namespace RolePlaying
             DrawButtons();
         }
 
-
         /// <summary>
         /// D
         /// </summary>
@@ -319,9 +287,9 @@ namespace RolePlaying
 
                 // Draw Right Trigger Information
                 position.Y += rightTriggerButton.Height;
-                placeTextMid = Fonts.PlayerStatisticsFont.MeasureString("Inventory");
+                placeTextMid = Fonts.PlayerStatisticsFont.MeasureString("Equipment");
                 position.X += (leftTriggerButton.Width / 2) - placeTextMid.X / 2;
-                spriteBatch.DrawString(Fonts.PlayerStatisticsFont, "Inventory", position,
+                spriteBatch.DrawString(Fonts.PlayerStatisticsFont, "Equipment", position,
                     Color.Black);
             }
 
@@ -354,7 +322,6 @@ namespace RolePlaying
             spriteBatch.Draw(goldIcon, goldIconPosition, Color.White);
         }
 
-
         /// <summary>
         /// Draws player information.
         /// </summary>
@@ -418,7 +385,6 @@ namespace RolePlaying
                 Color.White);
         }
 
-
         /// <summary>
         /// Draws Current Selected Player Count to Total Player count
         /// </summary>
@@ -448,7 +414,6 @@ namespace RolePlaying
                 Session.Party.Players.Count.ToString(), position, Fonts.CountColor);
         }
 
-
         /// <summary>
         /// Draw Equipment Info of the player selected 
         /// </summary>
@@ -459,20 +424,15 @@ namespace RolePlaying
             // Character name
             currentTextPosition = characterNamePosition;
 
-            currentTextPosition.X -=
-                Fonts.HeaderFont.MeasureString(selectedPlayer.Name).X / 2;
-            spriteBatch.DrawString(Fonts.HeaderFont, selectedPlayer.Name,
-                currentTextPosition, Fonts.TitleColor);
+            currentTextPosition.X -= Fonts.HeaderFont.MeasureString(selectedPlayer.Name).X / 2;
+            spriteBatch.DrawString(Fonts.HeaderFont, selectedPlayer.Name, currentTextPosition, Fonts.TitleColor);
 
             // Class name
             currentTextPosition = classNamePosition;
-            currentTextPosition.X -= Fonts.GearInfoFont.MeasureString(
-                selectedPlayer.CharacterClass.Name).X / 2;
-            spriteBatch.DrawString(Fonts.GearInfoFont,
-                selectedPlayer.CharacterClass.Name, currentTextPosition, Color.Black);
+            currentTextPosition.X -= Fonts.HeaderFont.MeasureString(selectedPlayer.CharacterClass.Name).X / 2;
+            spriteBatch.DrawString(Fonts.HeaderFont, selectedPlayer.CharacterClass.Name, currentTextPosition, Color.Black);
         }
 
-
         /// <summary>
         /// Draw Base Amount Plus any Modifiers
         /// </summary>
@@ -507,7 +467,6 @@ namespace RolePlaying
                 currentTextPosition, Color.Black);
         }
 
-
         /// <summary>
         /// Draw the equipment statistics
         /// </summary>

+ 4 - 27
RolePlayingGame/Core/RolePlayingGame.cs

@@ -34,6 +34,8 @@ namespace RolePlaying
             graphics.PreferredBackBufferWidth = BUFFER_WIDTH;
             graphics.PreferredBackBufferHeight = BUFFER_HEIGHT;
 
+            IsMouseVisible = true;
+
             // configure the content manager
             Content.RootDirectory = "Content";
 
@@ -42,7 +44,7 @@ namespace RolePlaying
             // Components.Add(new GamerServicesComponent(this));
 
             // add the audio manager
-            AudioManager.Initialize(this, @"Content\Audio\RpgAudio.xgs", 
+            AudioManager.Initialize(this, @"Content\Audio\RpgAudio.xgs",
                 @"Content\Audio\Wave Bank.xwb", @"Content\Audio\Sound Bank.xsb");
 
             // add the screen manager
@@ -50,7 +52,6 @@ namespace RolePlaying
             Components.Add(screenManager);
         }
 
-
         /// <summary>
         /// Allows the game to perform any initialization it needs to 
         /// before starting to run.  This is where it can query for any required 
@@ -68,7 +69,6 @@ namespace RolePlaying
             screenManager.AddScreen(new MainMenuScreen());
         }
 
-
         /// <summary>
         /// LoadContent will be called once per game and is the place to load
         /// all of your content.
@@ -80,7 +80,6 @@ namespace RolePlaying
             base.LoadContent();
         }
 
-
         /// <summary>
         /// UnloadContent will be called once per game and is the place to unload
         /// all content.
@@ -92,7 +91,6 @@ namespace RolePlaying
             base.UnloadContent();
         }
 
-
         /// <summary>
         /// Allows the game to run logic such as updating the world,
         /// checking for collisions, gathering input, and playing audio.
@@ -105,9 +103,6 @@ namespace RolePlaying
             base.Update(gameTime);
         }
 
-
-
-
         /// <summary>
         /// This is called when the game should draw itself.
         /// </summary>
@@ -118,23 +113,5 @@ namespace RolePlaying
 
             base.Draw(gameTime);
         }
-
-
-
-
-
-
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-//        static void Main(string[] args)
-//        {
-//            using (RolePlayingGame game = new RolePlayingGame())
-//            {
-//                game.Run();
-//            }
-//        }
-
-
     }
-}
+}

+ 1 - 1
RolePlayingGame/Core/Session/Party.cs

@@ -335,7 +335,7 @@ namespace RolePlaying
                 {
                     // TODO var equipment = contentManager.Load<Equipment>(equipmentAssetName);
 
-                    var equipment = Equipment.Load(equipmentAssetName);
+                    var equipment = Equipment.Load(equipmentAssetName, contentManager);
 
                     player.Equip(equipment);
                 }

+ 7 - 117
RolePlayingGame/Core/Session/Session.cs

@@ -20,18 +20,11 @@ namespace RolePlaying
 {
     class Session
     {
-
-
         /// <summary>
         /// The single Session instance that can be active at a time.
         /// </summary>
         private static Session singleton;
 
-
-
-
-
-
         /// <summary>
         /// The party that is playing the game right now.
         /// </summary>
@@ -45,11 +38,6 @@ namespace RolePlaying
             get { return (singleton == null ? null : singleton.party); }
         }
 
-
-
-
-
-
         /// <summary>
         /// Change the current map, arriving at the given portal if any.
         /// </summary>
@@ -88,7 +76,6 @@ namespace RolePlaying
                 map.FindPortal(originalPortal.DestinationMapPortalName));
         }
 
-
         /// <summary>
         /// Perform any actions associated withe the given tile.
         /// </summary>
@@ -224,7 +211,6 @@ namespace RolePlaying
             return false;
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering a FixedCombat entry.
         /// </summary>
@@ -243,7 +229,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering a Chest entry.
         /// </summary>
@@ -259,7 +244,6 @@ namespace RolePlaying
             singleton.screenManager.AddScreen(new ChestScreen(chestEntry));
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering a player-NPC entry.
         /// </summary>
@@ -275,7 +259,6 @@ namespace RolePlaying
             singleton.screenManager.AddScreen(new PlayerNpcScreen(playerEntry));
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering a QuestNpc entry.
         /// </summary>
@@ -291,7 +274,6 @@ namespace RolePlaying
             singleton.screenManager.AddScreen(new QuestNpcScreen(questNpcEntry));
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering an Inn entry.
         /// </summary>
@@ -307,7 +289,6 @@ namespace RolePlaying
             singleton.screenManager.AddScreen(new InnScreen(innEntry.Content));
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering a Store entry.
         /// </summary>
@@ -323,7 +304,6 @@ namespace RolePlaying
             singleton.screenManager.AddScreen(new StoreScreen(storeEntry.Content));
         }
 
-
         /// <summary>
         /// Performs the actions associated with encountering a Portal entry.
         /// </summary>
@@ -340,7 +320,6 @@ namespace RolePlaying
                 portalEntry.Content);
         }
 
-
         /// <summary>
         /// Check if a random combat should start.  If so, start combat immediately.
         /// </summary>
@@ -372,11 +351,6 @@ namespace RolePlaying
             return false;
         }
 
-
-
-
-
-
         /// <summary>
         /// The main quest line for this session.
         /// </summary>
@@ -390,7 +364,6 @@ namespace RolePlaying
             get { return (singleton == null ? null : singleton.questLine); }
         }
 
-
         /// <summary>
         /// If true, the main quest line for this session is complete.
         /// </summary>
@@ -408,7 +381,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// The current quest in this session.
         /// </summary>
@@ -422,7 +394,6 @@ namespace RolePlaying
             get { return (singleton == null ? null : singleton.quest); }
         }
 
-
         /// <summary>
         /// The index of the current quest into the quest line.
         /// </summary>
@@ -436,7 +407,6 @@ namespace RolePlaying
             get { return (singleton == null ? -1 : singleton.currentQuestIndex); }
         }
 
-
         /// <summary>
         /// Update the current quest and quest line for this session.
         /// </summary>
@@ -557,11 +527,6 @@ namespace RolePlaying
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// The chests removed from the map asset by player actions.
         /// </summary>
@@ -633,7 +598,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// The fixed-combats removed from the map asset by player actions.
         /// </summary>
@@ -705,7 +669,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// The player NPCs removed from the map asset by player actions.
         /// </summary>
@@ -749,7 +712,6 @@ namespace RolePlaying
             // quests don't have a list of player NPCs
         }
 
-
         /// <summary>
         /// The chests that have been modified, but not emptied, by player action.
         /// </summary>
@@ -811,7 +773,6 @@ namespace RolePlaying
                 return;
             }
 
-
             // look for the map entry within the quest
             if ((singleton.quest != null) && singleton.quest.ChestEntries.Exists(
                 delegate (WorldEntry<Chest> entry)
@@ -837,7 +798,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// Remove the specified content from the map, typically from an earlier session.
         /// </summary>
@@ -925,7 +885,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// Remove the specified content from the map, typically from an earlier session.
         /// </summary>
@@ -1005,7 +964,6 @@ namespace RolePlaying
             }
         }
 
-
         /// <summary>
         /// Modify a Chest object based on the data in a ModifiedChestEntry object.
         /// </summary>
@@ -1048,11 +1006,6 @@ namespace RolePlaying
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// The ScreenManager used to manage all UI in the game.
         /// </summary>
@@ -1066,13 +1019,11 @@ namespace RolePlaying
             get { return (singleton == null ? null : singleton.screenManager); }
         }
 
-
         /// <summary>
         /// The GameplayScreen object that created this session.
         /// </summary>
         private GameplayScreen gameplayScreen;
 
-
         /// <summary>
         /// The heads-up-display menu shown on the map and combat screens.
         /// </summary>
@@ -1086,11 +1037,6 @@ namespace RolePlaying
             get { return (singleton == null ? null : singleton.hud); }
         }
 
-
-
-
-
-
         /// <summary>
         /// Returns true if there is an active session.
         /// </summary>
@@ -1099,11 +1045,6 @@ namespace RolePlaying
             get { return singleton != null; }
         }
 
-
-
-
-
-
         /// <summary>
         /// Private constructor of a Session object.
         /// </summary>
@@ -1131,11 +1072,6 @@ namespace RolePlaying
             this.hud.LoadContent();
         }
 
-
-
-
-
-
         /// <summary>
         /// Update the session for this frame.
         /// </summary>
@@ -1159,11 +1095,6 @@ namespace RolePlaying
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// Draws the session environment to the screen
         /// </summary>
@@ -1193,8 +1124,14 @@ namespace RolePlaying
             }
 
             singleton.hud.Draw();
-        }
 
+#if DEBUG
+            // draw the debug information
+            spriteBatch.Begin();
+            spriteBatch.DrawString(Fonts.DebugFont, "Map: " + TileEngine.Map.AssetName, new Vector2(10, 10), Color.Yellow);
+            spriteBatch.End();
+#endif
+        }
 
         /// <summary>
         /// Draws everything related to the non-combat part of the screen
@@ -1426,7 +1363,6 @@ namespace RolePlaying
             spriteBatch.End();
         }
 
-
         /// <summary>
         /// Draw the shadows that appear under all characters.
         /// </summary>
@@ -1516,11 +1452,6 @@ namespace RolePlaying
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// Start a new session based on the data provided.
         /// </summary>
@@ -1565,11 +1496,6 @@ namespace RolePlaying
             singleton.questLine = loadedQuestLine;
         }
 
-
-
-
-
-
         /// <summary>
         /// End the current session.
         /// </summary>
@@ -1595,11 +1521,6 @@ namespace RolePlaying
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// Start a new session, using the data in the given save game.
         /// </summary>
@@ -1639,7 +1560,6 @@ namespace RolePlaying
             */
         }
 
-
         /// <summary>
         /// Receives the storage device and starts a new session, 
         /// using the data in the given save game.
@@ -1744,11 +1664,6 @@ namespace RolePlaying
         }
         */
 
-
-
-
-
-
         /// <summary>
         /// Save the current state of the session.
         /// </summary>
@@ -1767,7 +1682,6 @@ namespace RolePlaying
             */
         }
 
-
         /// <summary>
         /// Save the current state of the session, with the given storage device.
         /// </summary>
@@ -1882,11 +1796,6 @@ namespace RolePlaying
         }
         */
 
-
-
-
-
-
         /// <summary>
         /// Delete the save game specified by the description.
         /// </summary>
@@ -1910,7 +1819,6 @@ namespace RolePlaying
         }
         */
 
-
         /// <summary>
         /// Delete the save game specified by the description.
         /// </summary>
@@ -1947,11 +1855,6 @@ namespace RolePlaying
         }
         */
 
-
-
-
-
-
         /// <summary>
         /// Save game descriptions for the current set of save games.
         /// </summary>
@@ -1965,20 +1868,17 @@ namespace RolePlaying
             get { return saveGameDescriptions; }
         }
 
-
         /// <summary>
         /// The maximum number of save-game descriptions that the list may hold.
         /// </summary>
         public const int MaximumSaveGameDescriptions = 5;
 
-
         /// <summary>
         /// XML serializer for SaveGameDescription objects.
         /// </summary>
         private static XmlSerializer saveGameDescriptionSerializer =
             new XmlSerializer(typeof(SaveGameDescription));
 
-
         /// <summary>
         /// Refresh the list of save-game descriptions.
         /// </summary>
@@ -2046,11 +1946,6 @@ namespace RolePlaying
         }
         */
 
-
-
-
-
-
         /// <summary>
         /// The stored StorageDevice object.
         /// </summary>
@@ -2168,11 +2063,6 @@ namespace RolePlaying
         }
         */
 
-
-
-
-
-
         /// <summary>
         /// The random-number generator used with game events.
         /// </summary>

+ 19 - 10
RolePlayingGame/RolePlayingGameData/Animation/AnimatingSprite.cs

@@ -72,8 +72,8 @@ namespace RolePlaying.Data
         public Point FrameDimensions
         {
             get { return frameDimensions; }
-            set 
-            { 
+            set
+            {
                 frameDimensions = value;
                 frameOrigin.X = frameDimensions.X / 2;
                 frameOrigin.Y = frameDimensions.Y / 2;
@@ -110,7 +110,7 @@ namespace RolePlaying.Data
         /// <summary>
         /// The offset of this sprite from the position it's drawn at.
         /// </summary>
-        [ContentSerializer(Optional=true)]
+        [ContentSerializer(Optional = true)]
         public Vector2 SourceOffset
         {
             get { return sourceOffset; }
@@ -225,7 +225,7 @@ namespace RolePlaying.Data
             }
         }
 
-        
+
         /// <summary>
         /// Play an animation given by index.
         /// </summary>
@@ -390,7 +390,7 @@ namespace RolePlaying.Data
         /// <param name="position">The position of the sprite on-screen.</param>
         /// <param name="layerDepth">The depth at which the sprite is drawn.</param>
         /// <param name="spriteEffect">The sprite-effect applied.</param>
-        public void Draw(SpriteBatch spriteBatch, Vector2 position, float layerDepth, 
+        public void Draw(SpriteBatch spriteBatch, Vector2 position, float layerDepth,
             SpriteEffects spriteEffect)
         {
             // check the parameters
@@ -402,7 +402,7 @@ namespace RolePlaying.Data
             if (texture != null)
             {
                 spriteBatch.Draw(texture, position, sourceRectangle, Color.White, 0f,
-                    sourceOffset, 1f, spriteEffect, 
+                    sourceOffset, 1f, spriteEffect,
                     MathHelper.Clamp(layerDepth, 0f, 1f));
             }
         }
@@ -420,7 +420,7 @@ namespace RolePlaying.Data
             /// <summary>
             /// Read an AnimatingSprite object from the content pipeline.
             /// </summary>
-            protected override AnimatingSprite Read(ContentReader input, 
+            protected override AnimatingSprite Read(ContentReader input,
                 AnimatingSprite existingInstance)
             {
                 AnimatingSprite animatingSprite = existingInstance;
@@ -475,6 +475,7 @@ namespace RolePlaying.Data
 
         internal static AnimatingSprite Load(XElement xElement, ContentManager contentManager)
         {
+            // Create the AnimatingSprite object
             var animatingSprite = new AnimatingSprite
             {
                 TextureName = (string)xElement.Element("TextureName"),
@@ -484,13 +485,21 @@ namespace RolePlaying.Data
                     int.Parse(xElement.Element("FrameDimensions").Value.Split(' ')[0]),
                     int.Parse(xElement.Element("FrameDimensions").Value.Split(' ')[1])),
                 FramesPerRow = (int)xElement.Element("FramesPerRow"),
-                SourceOffset = new Vector2(
+                SourceOffset = xElement.Element("SourceOffset") != null ? new Vector2(
                     int.Parse(xElement.Element("SourceOffset").Value.Split(' ')[0]),
-                    int.Parse(xElement.Element("SourceOffset").Value.Split(' ')[1])),
+                    int.Parse(xElement.Element("SourceOffset").Value.Split(' ')[1])) : default,
+                Animations = xElement.Element("Animations")?.Elements("Item").Aggregate(
+                    new List<Animation>(),
+                    (list, animationElement) =>
+                    {
+                        var animation = Animation.Load(animationElement, contentManager);
+                        list.Add(animation);
+                        return list;
+                    }) ?? new List<Animation>()
                 // Handle Animations if needed
             };
 
             return animatingSprite;
         }
     }
-}
+}

+ 20 - 18
RolePlayingGame/RolePlayingGameData/Animation/Animation.cs

@@ -5,9 +5,11 @@
 // Copyright (C) Microsoft Corporation. All rights reserved.
 //-----------------------------------------------------------------------------
 
-using System;
 using Microsoft.Xna.Framework.Content;
+using System;
 using System.Diagnostics;
+using System.Xml;
+using System.Xml.Linq;
 
 namespace RolePlaying.Data
 {
@@ -35,7 +37,6 @@ namespace RolePlaying.Data
         }
 
 
-
         /// <summary>
         /// The first frame of the animation.
         /// </summary>
@@ -50,7 +51,6 @@ namespace RolePlaying.Data
             set { startingFrame = value; }
         }
 
-
         /// <summary>
         /// The last frame of the animation.
         /// </summary>
@@ -65,7 +65,6 @@ namespace RolePlaying.Data
             set { endingFrame = value; }
         }
 
-
         /// <summary>
         /// The interval between frames of the animation.
         /// </summary>
@@ -80,7 +79,6 @@ namespace RolePlaying.Data
             set { interval = value; }
         }
 
-
         /// <summary>
         /// If true, the animation loops.
         /// </summary>
@@ -95,19 +93,15 @@ namespace RolePlaying.Data
             set { isLoop = value; }
         }
 
-
-
-
         /// <summary>
         /// Creates a new Animation object.
         /// </summary>
         public Animation() { }
 
-
         /// <summary>
         /// Creates a new Animation object by full specification.
         /// </summary>
-        public Animation(string name, int startingFrame, int endingFrame, int interval, 
+        public Animation(string name, int startingFrame, int endingFrame, int interval,
             bool isLoop)
         {
             this.Name = name;
@@ -117,11 +111,6 @@ namespace RolePlaying.Data
             this.IsLoop = isLoop;
         }
 
-
-
-
-
-
         /// <summary>
         /// Read an Animation object from the content pipeline.
         /// </summary>
@@ -130,7 +119,7 @@ namespace RolePlaying.Data
             /// <summary>
             /// Read an Animation object from the content pipeline.
             /// </summary>
-            protected override Animation Read(ContentReader input, 
+            protected override Animation Read(ContentReader input,
                 Animation existingInstance)
             {
                 Animation animation = existingInstance;
@@ -151,6 +140,19 @@ namespace RolePlaying.Data
             }
         }
 
-
+        internal static Animation Load(XElement animationElement, ContentManager contentManager)
+        {
+            var animation = new Animation
+            {
+                AssetName = animationElement?.Value,
+                Name = animationElement?.Element("Name")?.Value,
+                StartingFrame = (int?)animationElement?.Element("StartingFrame") ?? 0,
+                EndingFrame = (int?)animationElement?.Element("EndingFrame") ?? 0,
+                Interval = (int?)animationElement?.Element("Interval") ?? 100,
+                IsLoop = (bool?)animationElement?.Element("IsLoop") ?? false,
+            };
+
+            return animation;
+        }
     }
-}
+}

+ 6 - 1
RolePlayingGame/RolePlayingGameData/Characters/Player.cs

@@ -320,7 +320,7 @@ namespace RolePlaying.Data
                 CharacterClassContentName = (string)asset.Element("CharacterClassContentName"),
                 CharacterLevel = (int)asset.Element("CharacterLevel"),
                 InitialEquipmentContentNames = asset.Element("InitialEquipmentContentNames")
-                    .Elements("Item").Select(x => (string)x).ToList(),
+                    .Elements("Item").Select(x => (string)x).ToList() ?? new List<string>(),
                 CombatSprite = AnimatingSprite.Load(asset.Element("CombatSprite"), contentManager),
                 Gold = (int)asset.Element("Gold"),
                 IntroductionDialogue = (string)asset.Element("IntroductionDialogue"),
@@ -338,6 +338,7 @@ namespace RolePlaying.Data
                 Inventory = asset.Element("Inventory")?.Elements("Item")
                     .Select(x => new ContentEntry<Gear>
                     {
+                        Content = Item.Load(Path.Combine(@"Gear", (string)x.Element("ContentName")), contentManager),
                         ContentName = (string)x.Element("ContentName"),
                         Count = (int?)x.Element("Count") ?? 1 // Default to 1 if not specified
                     })
@@ -346,6 +347,10 @@ namespace RolePlaying.Data
 
             // load the character class
             player.CharacterClass = CharacterClass.Load(Path.Combine("CharacterClasses", player.CharacterClassContentName));
+            foreach (var item in player.InitialEquipmentContentNames)
+            {
+                player.EquippedEquipment.Add(Equipment.Load(Path.Combine(@"Gear", item), contentManager));
+            }
 
             player.AddStandardCharacterCombatAnimations();
             player.AddStandardCharacterIdleAnimations();

+ 1 - 3
RolePlayingGame/RolePlayingGameData/Characters/QuestNpc.cs

@@ -18,8 +18,6 @@ namespace RolePlaying.Data
     /// </summary>
     public class QuestNpc : Character
     {
-
-
         /// <summary>
         /// The dialogue that the Npc says when it is greeted in the world.
         /// </summary>
@@ -43,7 +41,7 @@ namespace RolePlaying.Data
                 AssetName = npcPath,
                 Name = (string)asset.Element("Name"),
                 Direction = Enum.TryParse<Direction>((string)asset.Element("Direction"), out var dir) ? dir : default,
-                IntroductionDialogue = (string)asset.Element("IntroductionDialogue"),
+                IntroductionDialogue = asset.Element("IntroductionDialogue").Value,
                 MapIdleAnimationInterval = asset.Element("MapIdleAnimationInterval") != null
                     ? int.TryParse((string)asset.Element("MapIdleAnimationInterval"), out var interval) ? interval : default
                     : default,

+ 16 - 2
RolePlayingGame/RolePlayingGameData/Gear/Equipment.cs

@@ -7,7 +7,9 @@
 
 using System;
 using System.Collections.Generic;
+using System.IO;
 using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
 
 namespace RolePlaying.Data
 {
@@ -35,9 +37,21 @@ namespace RolePlaying.Data
             set { ownerBuffStatistics = value; }
         }
 
-        public static Equipment Load(string equipmentAssetName)
+        public static Equipment Load(string equipmentAssetName, ContentManager contentManager)
         {
-            throw new NotImplementedException();
+            var equipmentAsset = XmlHelper.GetAssetElementFromXML(equipmentAssetName);
+            var equipment = new Equipment()
+            {
+                AssetName = equipmentAssetName,
+                Name = (string)equipmentAsset.Element("Name"),
+                Description = (string)equipmentAsset.Element("Description"),
+                GoldValue = (int)equipmentAsset.Element("GoldValue"),
+                IconTextureName = (string)equipmentAsset.Element("IconTextureName"),
+                IconTexture = contentManager.Load<Texture2D>(Path.Combine("Textures", "Gear", (string)equipmentAsset.Element("IconTextureName"))),
+                MinimumCharacterLevel = int.Parse(equipmentAsset.Element("MinimumCharacterLevel").Value),
+            };
+
+            return equipment;
         }
 
         /// <summary>

+ 32 - 26
RolePlayingGame/RolePlayingGameData/Gear/Item.cs

@@ -5,11 +5,12 @@
 // Copyright (C) Microsoft Corporation. All rights reserved.
 //-----------------------------------------------------------------------------
 
-using System;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Content;
 using Microsoft.Xna.Framework.Graphics;
+using System;
 using System.Collections.Generic;
+using System.IO;
 
 namespace RolePlaying.Data
 {
@@ -18,8 +19,6 @@ namespace RolePlaying.Data
     /// </summary>
     public class Item : Gear
     {
-
-
         /// <summary>
         /// Flags that specify when an item may be used.
         /// </summary>
@@ -28,8 +27,7 @@ namespace RolePlaying.Data
             Combat = 1,
             NonCombat = 2,
         };
-        
-        
+
         /// <summary>
         /// Description of when the item may be used.
         /// </summary>
@@ -71,7 +69,6 @@ namespace RolePlaying.Data
             set { isOffensive = value; }
         }
 
-
         /// <summary>
         /// The duration of the effect of this item on its target, in rounds.
         /// </summary>
@@ -92,7 +89,6 @@ namespace RolePlaying.Data
             set { targetDuration = value; }
         }
 
-
         /// <summary>
         /// The range of statistics effects of this item on its target.
         /// </summary>
@@ -113,7 +109,6 @@ namespace RolePlaying.Data
             set { targetEffectRange = value; }
         }
 
-
         /// <summary>
         /// The number of simultaneous, adjacent targets affected by this item.
         /// </summary>
@@ -142,7 +137,6 @@ namespace RolePlaying.Data
             set { usingCueName = value; }
         }
 
-
         /// <summary>
         /// The name of the sound effect cue played when the item effect is traveling.
         /// </summary>
@@ -157,7 +151,6 @@ namespace RolePlaying.Data
             set { travelingCueName = value; }
         }
 
-
         /// <summary>
         /// The name of the sound effect cue played when the item affects its target.
         /// </summary>
@@ -172,7 +165,6 @@ namespace RolePlaying.Data
             set { impactCueName = value; }
         }
 
-
         /// <summary>
         /// The name of the sound effect cue played when the item effect is blocked.
         /// </summary>
@@ -187,11 +179,6 @@ namespace RolePlaying.Data
             set { blockCueName = value; }
         }
 
-
-
-
-
-
         /// <summary>
         /// An animating sprite used when this item is used.
         /// </summary>
@@ -208,14 +195,13 @@ namespace RolePlaying.Data
         /// This is optional.  If it is null, then a Using or Creating animation
         /// in SpellSprite is used.
         /// </remarks>
-        [ContentSerializer(Optional=true)]
+        [ContentSerializer(Optional = true)]
         public AnimatingSprite CreationSprite
         {
             get { return creationSprite; }
             set { creationSprite = value; }
         }
 
-
         /// <summary>
         /// The animating sprite used when this item is in action.
         /// </summary>
@@ -230,7 +216,6 @@ namespace RolePlaying.Data
             set { spellSprite = value; }
         }
 
-
         /// <summary>
         /// The overlay sprite for this item.
         /// </summary>
@@ -245,10 +230,33 @@ namespace RolePlaying.Data
             set { overlay = value; }
         }
 
-    
-
-
-
+        internal static Item Load(string itemAssetName, ContentManager contentManager)
+        {
+            var itemAsset = XmlHelper.GetAssetElementFromXML(itemAssetName);
+            var item = new Item()
+            {
+                AssetName = itemAssetName,
+                Name = (string)itemAsset.Element("Name"),
+                Description = (string)itemAsset.Element("Description"),
+                GoldValue = (int)itemAsset.Element("GoldValue"),
+                IconTextureName = (string)itemAsset.Element("IconTextureName"),
+                IconTexture = contentManager.Load<Texture2D>(Path.Combine("Textures", "Gear", (string)itemAsset.Element("IconTextureName"))),
+                MinimumCharacterLevel = int.Parse(itemAsset.Element("MinimumCharacterLevel").Value),
+                Usage = itemAsset.Element("Usage") != null ? (ItemUsage)Enum.Parse(typeof(ItemUsage), (string)itemAsset.Element("Usage")) : default,
+                IsOffensive = bool.Parse(itemAsset.Element("IsOffensive").Value),
+                TargetDuration = int.Parse(itemAsset.Element("TargetDuration").Value),
+                AdjacentTargets = int.Parse(itemAsset.Element("AdjacentTargets").Value),
+                UsingCueName = (string)itemAsset.Element("UsingCueName"),
+                TravelingCueName = (string)itemAsset.Element("TravelingCueName"),
+                ImpactCueName = (string)itemAsset.Element("ImpactCueName"),
+                BlockCueName = (string)itemAsset.Element("BlockCueName"),
+                CreationSprite = itemAsset.Element("CreatingSprite") != null ? AnimatingSprite.Load(itemAsset.Element("CreatingSprite"), contentManager) : null,
+                SpellSprite = itemAsset.Element("SpellSprite") != null ? AnimatingSprite.Load(itemAsset.Element("SpellSprite"), contentManager) : null,
+                Overlay = itemAsset.Element("Overlay") != null ? AnimatingSprite.Load(itemAsset.Element("Overlay"), contentManager) : null,
+            };
+
+            return item;
+        }
 
         /// <summary>
         /// Read an Item object from the content pipeline
@@ -292,7 +300,5 @@ namespace RolePlaying.Data
                 return item;
             }
         }
-
-
     }
-}
+}

+ 43 - 26
RolePlayingGame/RolePlayingGameData/Map/Chest.cs

@@ -5,10 +5,13 @@
 // Copyright (C) Microsoft Corporation. All rights reserved.
 //-----------------------------------------------------------------------------
 
-using System;
-using System.Collections.Generic;
 using Microsoft.Xna.Framework.Content;
 using Microsoft.Xna.Framework.Graphics;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Linq;
 
 namespace RolePlaying.Data
 {
@@ -20,8 +23,6 @@ namespace RolePlaying.Data
 , ICloneable
 #endif
     {
-
-
         /// <summary>
         /// The amount of gold in the chest.
         /// </summary>
@@ -37,7 +38,6 @@ namespace RolePlaying.Data
             set { gold = value; }
         }
 
-
         /// <summary>
         /// The gear in the chest, along with quantities.
         /// </summary>
@@ -52,7 +52,6 @@ namespace RolePlaying.Data
             set { entries = value; }
         }
 
-
         /// <summary>
         /// Array accessor for the chest's contents.
         /// </summary>
@@ -61,7 +60,6 @@ namespace RolePlaying.Data
             get { return entries[index]; }
         }
 
-
         /// <summary>
         /// Returns true if the chest is empty.
         /// </summary>
@@ -70,11 +68,6 @@ namespace RolePlaying.Data
             get { return ((gold <= 0) && (entries.Count <= 0)); }
         }
 
-
-
-
-
-
         /// <summary>
         /// The content name of the texture for this chest.
         /// </summary>
@@ -89,7 +82,6 @@ namespace RolePlaying.Data
             set { textureName = value; }
         }
 
-
         /// <summary>
         /// The texture for this chest.
         /// </summary>
@@ -105,11 +97,6 @@ namespace RolePlaying.Data
             set { texture = value; }
         }
 
-
-
-
-
-
         /// <summary>
         /// Reads a Chest object from the content pipeline.
         /// </summary>
@@ -136,7 +123,7 @@ namespace RolePlaying.Data
                         System.IO.Path.Combine(@"Gear",
                         contentEntry.ContentName));
                 }
-                
+
                 chest.TextureName = input.ReadString();
                 chest.Texture = input.ContentManager.Load<Texture2D>(
                     System.IO.Path.Combine(@"Textures\Chests", chest.TextureName));
@@ -145,11 +132,6 @@ namespace RolePlaying.Data
             }
         }
 
-
-
-
-
-
         /// <summary>
         /// Clone implementation for chest copies.
         /// </summary>
@@ -182,6 +164,41 @@ namespace RolePlaying.Data
             return chest;
         }
 
-
+        internal static Chest Load(XElement chestAsset, ContentManager contentManager)
+        {
+            var chest = new Chest
+            {
+                Name = (string)chestAsset.Element("Name"),
+                Gold = (int)chestAsset.Element("Gold"),
+                Entries = chestAsset.Element("Entries")?.Elements("Item").Select(chestItem =>
+                {
+                    var contentName = (string)chestItem.Element("ContentName");
+                    var gearAsset = XmlHelper.GetAssetElementFromXML(Path.Combine(@"Gear", contentName));
+                    var gear = new Equipment
+                    {
+                        AssetName = contentName,
+                        Name = (string)gearAsset.Element("Name"),
+                        Description = (string)gearAsset.Element("Description"),
+                        GoldValue = (int?)gearAsset.Element("GoldValue") ?? 0,
+                        IconTextureName = (string)gearAsset.Element("IconTextureName"),
+                        IconTexture = contentManager.Load<Texture2D>(
+                            Path.Combine(@"Textures\Gear", (string)gearAsset.Element("IconTextureName"))),
+                        IsDroppable = (bool?)gearAsset.Element("IsDroppable") ?? true,
+
+                        // Add other properties as needed
+                    };
+
+                    return new ContentEntry<Gear>
+                    {
+                        ContentName = contentName,
+                        Content = gear,
+                        Count = (int?)chestItem.Element("Count") ?? 1,
+                    };
+                }).ToList(),
+                TextureName = (string)chestAsset.Element("TextureName"),
+                Texture = contentManager.Load<Texture2D>(Path.Combine("Textures", "Chests", (string)chestAsset.Element("TextureName"))),
+            };
+            return chest;
+        }
     }
-}
+}

+ 82 - 181
RolePlayingGame/RolePlayingGameData/Map/Map.cs

@@ -23,8 +23,6 @@ namespace RolePlaying.Data
 , ICloneable
 #endif
     {
-
-
         /// <summary>
         /// The name of this section of the world.
         /// </summary>
@@ -53,7 +51,6 @@ namespace RolePlaying.Data
             set { mapDimensions = value; }
         }
 
-
         /// <summary>
         /// The size of the tiles in this map, in pixels.
         /// </summary>
@@ -68,7 +65,6 @@ namespace RolePlaying.Data
             set { tileSize = value; }
         }
 
-
         /// <summary>
         /// The number of tiles in a row of the map texture.
         /// </summary>
@@ -90,11 +86,6 @@ namespace RolePlaying.Data
             set { tilesPerRow = value; }
         }
 
-
-
-
-
-
         /// <summary>
         /// A valid spawn position for this map. 
         /// </summary>
@@ -109,11 +100,6 @@ namespace RolePlaying.Data
             set { spawnMapPosition = value; }
         }
 
-
-
-
-
-
         /// <summary>
         /// The content name of the texture that contains the tiles for this map.
         /// </summary>
@@ -128,7 +114,6 @@ namespace RolePlaying.Data
             set { textureName = value; }
         }
 
-
         /// <summary>
         /// The texture that contains the tiles for this map.
         /// </summary>
@@ -144,7 +129,6 @@ namespace RolePlaying.Data
             set { texture = value; }
         }
 
-
         /// <summary>
         /// The content name of the texture that contains the background for combats 
         /// that occur while traveling on this map.
@@ -161,7 +145,6 @@ namespace RolePlaying.Data
             set { combatTextureName = value; }
         }
 
-
         /// <summary>
         /// The texture that contains the background for combats 
         /// that occur while traveling on this map.
@@ -179,11 +162,6 @@ namespace RolePlaying.Data
             set { combatTexture = value; }
         }
 
-
-
-
-
-
         /// <summary>
         /// The name of the music cue for this map.
         /// </summary>
@@ -198,7 +176,6 @@ namespace RolePlaying.Data
             set { musicCueName = value; }
         }
 
-
         /// <summary>
         /// The name of the music cue for combats that occur while traveling on this map.
         /// </summary>
@@ -213,13 +190,6 @@ namespace RolePlaying.Data
             set { combatMusicCueName = value; }
         }
 
-
-
-
-
-
-
-
         /// <summary>
         /// Spatial array for the ground tiles for this map.
         /// </summary>
@@ -234,7 +204,6 @@ namespace RolePlaying.Data
             set { baseLayer = value; }
         }
 
-
         /// <summary>
         /// Retrieves the base layer value for the given map position.
         /// </summary>
@@ -250,7 +219,6 @@ namespace RolePlaying.Data
             return baseLayer[mapPosition.Y * mapDimensions.X + mapPosition.X];
         }
 
-
         /// <summary>
         /// Retrieves the source rectangle for the tile in the given position
         /// in the base layer.
@@ -277,10 +245,6 @@ namespace RolePlaying.Data
                 tileSize.X, tileSize.Y);
         }
 
-
-
-
-
         /// <summary>
         /// Spatial array for the fringe tiles for this map.
         /// </summary>
@@ -295,7 +259,6 @@ namespace RolePlaying.Data
             set { fringeLayer = value; }
         }
 
-
         /// <summary>
         /// Retrieves the fringe layer value for the given map position.
         /// </summary>
@@ -311,7 +274,6 @@ namespace RolePlaying.Data
             return fringeLayer[mapPosition.Y * mapDimensions.X + mapPosition.X];
         }
 
-
         /// <summary>
         /// Retrieves the source rectangle for the tile in the given position
         /// in the fringe layer.
@@ -338,11 +300,6 @@ namespace RolePlaying.Data
                 tileSize.X, tileSize.Y);
         }
 
-
-
-
-
-
         /// <summary>
         /// Spatial array for the object images on this map.
         /// </summary>
@@ -357,7 +314,6 @@ namespace RolePlaying.Data
             set { objectLayer = value; }
         }
 
-
         /// <summary>
         /// Retrieves the object layer value for the given map position.
         /// </summary>
@@ -373,7 +329,6 @@ namespace RolePlaying.Data
             return objectLayer[mapPosition.Y * mapDimensions.X + mapPosition.X];
         }
 
-
         /// <summary>
         /// Retrieves the source rectangle for the tile in the given position
         /// in the object layer.
@@ -400,11 +355,6 @@ namespace RolePlaying.Data
                 tileSize.X, tileSize.Y);
         }
 
-
-
-
-
-
         /// <summary>
         /// Spatial array for the collision properties of this map.
         /// </summary>
@@ -419,7 +369,6 @@ namespace RolePlaying.Data
             set { collisionLayer = value; }
         }
 
-
         /// <summary>
         /// Retrieves the collision layer value for the given map position.
         /// </summary>
@@ -435,7 +384,6 @@ namespace RolePlaying.Data
             return collisionLayer[mapPosition.Y * mapDimensions.X + mapPosition.X];
         }
 
-
         /// <summary>
         /// Returns true if the given map position is blocked.
         /// </summary>
@@ -452,13 +400,6 @@ namespace RolePlaying.Data
             return (GetCollisionLayerValue(mapPosition) != 0);
         }
 
-
-
-
-
-
-
-
         /// <summary>
         /// Portals to other maps.
         /// </summary>
@@ -473,11 +414,6 @@ namespace RolePlaying.Data
             set { portals = value; }
         }
 
-
-
-
-
-
         /// <summary>
         /// The content names and positions of the portals on this map.
         /// </summary>
@@ -510,7 +446,6 @@ namespace RolePlaying.Data
             });
         }
 
-
         /// <summary>
         /// The content names and positions of the treasure chests on this map.
         /// </summary>
@@ -526,7 +461,6 @@ namespace RolePlaying.Data
             set { chestEntries = value; }
         }
 
-
         /// <summary>
         /// The content name, positions, and orientations of the 
         /// fixed combat encounters on this map.
@@ -544,7 +478,6 @@ namespace RolePlaying.Data
             set { fixedCombatEntries = value; }
         }
 
-
         /// <summary>
         /// The random combat definition for this map.
         /// </summary>
@@ -559,7 +492,6 @@ namespace RolePlaying.Data
             set { randomCombat = value; }
         }
 
-
         /// <summary>
         /// The content names, positions, and orientations of quest Npcs on this map.
         /// </summary>
@@ -575,7 +507,6 @@ namespace RolePlaying.Data
             set { questNpcEntries = value; }
         }
 
-
         /// <summary>
         /// The content names, positions, and orientations of player Npcs on this map.
         /// </summary>
@@ -591,7 +522,6 @@ namespace RolePlaying.Data
             set { playerNpcEntries = value; }
         }
 
-
         /// <summary>
         /// The content names, positions, and orientations of the inns on this map.
         /// </summary>
@@ -607,7 +537,6 @@ namespace RolePlaying.Data
             set { innEntries = value; }
         }
 
-
         /// <summary>
         /// The content names, positions, and orientations of the stores on this map.
         /// </summary>
@@ -733,14 +662,14 @@ namespace RolePlaying.Data
                         var portalItem = asset.Element("Portals")?.Elements("Item").FirstOrDefault(p => (string)p.Element("Name") == contentName);
 
                         var portal = new Portal
-						{
+                        {
                             Name = (string)portalItem.Element("Name"),
-							LandingMapPosition = new Point(
-							    int.Parse(portalItem.Element("LandingMapPosition").Value.Split(' ')[0]),
-							    int.Parse(portalItem.Element("LandingMapPosition").Value.Split(' ')[1])),
-							DestinationMapContentName = (string)portalItem.Element("DestinationMapContentName"),
-							DestinationMapPortalName = (string)portalItem.Element("DestinationMapPortalName")
-						};
+                            LandingMapPosition = new Point(
+                                int.Parse(portalItem.Element("LandingMapPosition").Value.Split(' ')[0]),
+                                int.Parse(portalItem.Element("LandingMapPosition").Value.Split(' ')[1])),
+                            DestinationMapContentName = (string)portalItem.Element("DestinationMapContentName"),
+                            DestinationMapPortalName = (string)portalItem.Element("DestinationMapPortalName")
+                        };
 
                         return new MapEntry<Portal>
                         {
@@ -751,63 +680,36 @@ namespace RolePlaying.Data
                         };
                     }).ToList(),
                 ChestEntries = asset.Element("ChestEntries")?.Elements("Item")
-                    .Select(item => {
-						var contentName = (string)item.Element("ContentName");
-						var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
-						var mapPosition = new Point(
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
-
-						// Load the QuestNpc asset XML using contentName
-						var chestAsset = XmlHelper.GetAssetElementFromXML(Path.Combine(@"Maps/Chests", contentName));
-						var chest = new Chest
-						{
-							Name = (string)chestAsset.Element("Name"),
-                            Gold = (int)chestAsset.Element("Gold"),
-							Entries = chestAsset.Element("Entries")?.Elements("Item").Select(chestItem => {
-								var contentName = (string)chestItem.Element("ContentName");
-								var gearAsset = XmlHelper.GetAssetElementFromXML(Path.Combine(@"Gear", contentName));
-								var gear = new Equipment
-								{
-                                    AssetName = contentName,
-									Name = (string)gearAsset.Element("Name"),
-									Description = (string)gearAsset.Element("Description"),
-									GoldValue = (int?)gearAsset.Element("GoldValue") ?? 0,
-									IconTextureName = (string)gearAsset.Element("IconTextureName"),
-									IconTexture = contentManager.Load<Texture2D>(
-										Path.Combine(@"Textures\Gear", (string)gearAsset.Element("IconTextureName"))),
-									// Add other properties as needed
-								};
-
-								return new ContentEntry<Gear>
-								{
-									ContentName = contentName,
-									Content = gear,
-									Count = (int?)chestItem.Element("Count") ?? 1,
-								};
-							}).ToList(),
-							TextureName = (string)chestAsset.Element("TextureName"),
-							Texture = contentManager.Load<Texture2D>(
-					            Path.Combine(@"Textures\Chests", (string)chestAsset.Element("TextureName"))),
-						};
-
-						return new MapEntry<Chest>
-						{
-							ContentName = contentName,
-							Content = chest,
-							Direction = direction,
-							MapPosition = mapPosition
-						};
-					}).ToList(),
+                    .Select(item =>
+                    {
+                        var contentName = (string)item.Element("ContentName");
+                        var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
+                        var mapPosition = new Point(
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
+
+                        // Load the QuestNpc asset XML using contentName
+                        var chestAsset = XmlHelper.GetAssetElementFromXML(Path.Combine(@"Maps/Chests", contentName));
+                        var chest = Chest.Load(chestAsset, contentManager);
+
+                        return new MapEntry<Chest>
+                        {
+                            ContentName = contentName,
+                            Content = chest,
+                            Direction = direction,
+                            MapPosition = mapPosition
+                        };
+                    }).ToList(),
                 FixedCombatEntries = asset.Element("FixedCombatEntries")?.Elements("Item")
-                    .Select(item => {
-						var contentName = (string)item.Element("ContentName");
-						var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
-						var mapPosition = new Point(
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
-
-						// Load the fixed combat asset XML using contentName
+                    .Select(item =>
+                    {
+                        var contentName = (string)item.Element("ContentName");
+                        var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
+                        var mapPosition = new Point(
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
+
+                        // Load the fixed combat asset XML using contentName
                         var fixedCombat = FixedCombat.Load(Path.Combine(@"Maps/FixedCombats", contentName), contentManager);
 
                         AnimatingSprite animatingSprite = null;
@@ -817,7 +719,7 @@ namespace RolePlaying.Data
                             animatingSprite = fixedCombat.Entries[0].Content.MapSprite.Clone() as AnimatingSprite;
                         }
 
-						return new MapEntry<FixedCombat>
+                        return new MapEntry<FixedCombat>
                         {
                             ContentName = contentName,
                             Content = fixedCombat,
@@ -825,16 +727,17 @@ namespace RolePlaying.Data
                             MapPosition = mapPosition,
                             MapSprite = animatingSprite,
                         };
-					}).ToList(),
+                    }).ToList(),
                 PlayerNpcEntries = asset.Element("PlayerNpcEntries")?.Elements("Item")
-                    .Select(item => {
-						var contentName = (string)item.Element("ContentName");
-						var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
-						var mapPosition = new Point(
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
-
-						// Load the PlayerNpc asset XML using contentName
+                    .Select(item =>
+                    {
+                        var contentName = (string)item.Element("ContentName");
+                        var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
+                        var mapPosition = new Point(
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
+
+                        // Load the PlayerNpc asset XML using contentName
                         var playerNpc = Player.Load(Path.Combine(@"Characters/Players", contentName), contentManager);
 
                         return new MapEntry<Player>
@@ -844,64 +747,67 @@ namespace RolePlaying.Data
                             Direction = direction,
                             MapPosition = mapPosition
                         };
-					}).ToList(),
+                    }).ToList(),
                 QuestNpcEntries = asset.Element("QuestNpcEntries")?.Elements("Item")
-                    .Select(item => {
-						var contentName = (string)item.Element("ContentName");
-						var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
-						var mapPosition = new Point(
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
-
-						// Load the QuestNpc asset XML using contentName
+                    .Select(item =>
+                    {
+                        var contentName = (string)item.Element("ContentName");
+                        var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
+                        var mapPosition = new Point(
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
+
+                        // Load the QuestNpc asset XML using contentName
                         var questNpc = QuestNpc.Load(Path.Combine(@"Characters/QuestNPCs", contentName), contentManager);
-                        
-						return new MapEntry<QuestNpc>
+
+                        return new MapEntry<QuestNpc>
                         {
                             ContentName = contentName,
                             Content = questNpc,
                             Direction = direction,
                             MapPosition = mapPosition
                         };
-					}).ToList(),
+                    }).ToList(),
                 InnEntries = asset.Element("InnEntries")?.Elements("Item")
-                    .Select(item => {
-						var contentName = (string)item.Element("ContentName");
-						var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
-						var mapPosition = new Point(
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
-
-						// Load the Inn asset XML using contentName
+                    .Select(item =>
+                    {
+                        var contentName = (string)item.Element("ContentName");
+                        var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
+                        var mapPosition = new Point(
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
+
+                        // Load the Inn asset XML using contentName
                         var inn = Inn.Load(Path.Combine(@"Maps/Inns", contentName), contentManager);
 
-						return new MapEntry<Inn>
+                        return new MapEntry<Inn>
                         {
                             ContentName = contentName,
                             Content = inn,
                             Direction = direction,
                             MapPosition = mapPosition
                         };
-					}).ToList(),
+                    }).ToList(),
                 StoreEntries = asset.Element("StoreEntries")?.Elements("Item")
-                    .Select(item => {
-						var contentName = (string)item.Element("ContentName");
-						var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
-						var mapPosition = new Point(
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
-							int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
-
-						// Load the Store asset XML using contentName
+                    .Select(item =>
+                    {
+                        var contentName = (string)item.Element("ContentName");
+                        var direction = Enum.TryParse<Direction>((string)item.Element("Direction"), out var dir) ? dir : default;
+                        var mapPosition = new Point(
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[0]),
+                            int.Parse(item.Element("MapPosition").Value.Split(' ')[1]));
+
+                        // Load the Store asset XML using contentName
                         var store = Store.Load(Path.Combine(@"Maps/Stores", contentName), contentManager);
 
-						return new MapEntry<Store>
+                        return new MapEntry<Store>
                         {
                             ContentName = contentName,
                             Content = store,
                             Direction = direction,
                             MapPosition = mapPosition
                         };
-					}).ToList(),
+                    }).ToList(),
             };
 
             var randomCombatElement = asset.Element("RandomCombat");
@@ -931,11 +837,6 @@ namespace RolePlaying.Data
             return map;
         }
 
-
-
-
-
-
         /// <summary>
         /// Read a Map object from the content pipeline.
         /// </summary>