Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MapContentReader : ContentTypeReader<Lib.Map>
- {
- protected override Map Read(
- ContentReader input,
- Map existingInstance)
- {
- Map map = existingInstance;
- if (map == null)
- {
- map = new Map();
- }
- map.filename = input.ReadString();
- map.numberOfLayers = input.ReadInt32();
- map.mapWidth = input.ReadInt32();
- map.mapHeight = input.ReadInt32();
- map.Map_Data = input.ReadString();
- map.Number_Of_Anim_Tiles = input.ReadInt32();
- map.Animated_Tiles = input.ReadObject<List<AnimatedTiles>>();
- return map;
- }
- }
- //AnimatedTiles Class
- public class AnimatedTiles
- {
- #region Fields
- private int positionX;
- private int positionY;
- private string ID;
- #endregion
- #region Public Methods
- public int PositionX
- {
- get { return positionX; }
- set { positionX = value; }
- }
- public int PositionY
- {
- get { return positionY; }
- set { positionY = value; }
- }
- public string Type
- {
- get { return ID; }
- set { ID = value; }
- }
- #endregion
- public AnimatedTiles() { }
- public AnimatedTiles(int X, int Y, string tileID)
- {
- positionX = X;
- positionY = Y;
- ID = tileID;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement