Exemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Map()
        {
            saveData = SaveData.Instance();

            GameState = GameState.Menu;

            map = new short[Constants.MAP_SIZE, Constants.MAP_SIZE];
            visible = new short[Constants.MAP_SIZE, Constants.MAP_SIZE];

            monsterList = new List<Monster>();
            bloodList = new List<Tile>();
            magicTileList = new List<MagicTile>();
            bonusList = new List<BonusTile>();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Get instance this class
 /// </summary>
 /// <returns>This class</returns>
 public static SaveData Instance()
 {
     if (_Instance == null)
         _Instance = new SaveData();
     return _Instance;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Load data
 /// </summary>
 public void LoadSaveData()
 {
     if (File.Exists(Constants.SAVEDATA_FILENAME))
     {
         Stream FileStream = File.OpenRead(Constants.SAVEDATA_FILENAME);
         BinaryFormatter deserializer = new BinaryFormatter();
         saveData = (SaveData)deserializer.Deserialize(FileStream);
         FileStream.Close();
     }
 }