本文整理汇总了C#中FileManager.Deserialize方法的典型用法代码示例。如果您正苦于以下问题:C# FileManager.Deserialize方法的具体用法?C# FileManager.Deserialize怎么用?C# FileManager.Deserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager.Deserialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadMission
public void LoadMission(int missionId)
{
// TU EWENTUALNIE MOŻNA BY DODAC JAKIS KOD NA OKNO WCZYTYWANIA NOWEGO POZIOMU
FileManager fileManager = new FileManager();
GameManager newInstance = fileManager.Deserialize<GameManager>(@"Missions\Mission" + missionId);
newInstance.GameMap.Load(content);
foreach (Enemy e in newInstance.Enemies)
e.Load(content);
foreach (Fighter f in newInstance.Fighters)
f.Load(content);
MissionId = missionId;
GameMap = newInstance.GameMap;
Fighters = newInstance.Fighters;
Enemies = newInstance.Enemies;
Bonuses = newInstance.Bonuses;
WeaponsArsenal = new List<DataItem<Weapon, int>>();
Missiles = new List<Missile>();
}
示例2: Load
/// <summary>
/// Metoda statyczna generujaca cala klase GameManager
/// </summary>
public static GameManager Load(ContentManager content, Difficulty difficulty, ScreenManager screenManager)
{
FileManager fileManager = new FileManager();
GameManager newInstance = fileManager.Deserialize<GameManager>(@"Missions\Mission1");
newInstance.Fighters = new List<Fighter>();
newInstance.Bonuses = new List<Bonus>();
newInstance.Missiles = new List<Missile>();
newInstance.GameMap.Load(content);
foreach (Enemy e in newInstance.Enemies)
e.Load(content);
foreach (Fighter f in newInstance.Fighters)
f.Load(content);
newInstance.difficulty = difficulty;
newInstance.screenManager = screenManager;
newInstance.MissionId = 1;
newInstance.content = content;
newInstance.GameInterface = new GameInterface();
newInstance.GameInterface.Load(content);
return newInstance;
}