public Savegame(Savegame pSavegame) { Initialize(); Collectables = pSavegame.Collectables; InventoryHansel = pSavegame.InventoryHansel; InventoryGretel = pSavegame.InventoryGretel; Chalk = pSavegame.Chalk; PositionHansel = pSavegame.PositionHansel; PositionGretel = pSavegame.PositionGretel; SceneId = pSavegame.SceneId; Scenes = pSavegame.Scenes; }
public void Initialize() { ScenePath = Environment.CurrentDirectory + @"\Content\hug"; SavegamePath = Environment.CurrentDirectory + @"\save.hugs"; //Hänsel Und Gretel Savegame SceneSerializer = new XmlSerializer(typeof(SceneData)); SavegameSerializer = new XmlSerializer(typeof(Savegame)); Collectables = new List<Collectable>(); InventoryHansel = new Inventory(); InventoryGretel = new Inventory(); Chalk = 0; PositionHansel = new Vector2(80, 500); //ToDo: Init Position setzen !---!---!---!---! PositionGretel = new Vector2(150, 500); //ToDo: Init Position setzen !---!---!---!---! SceneId = 0; Scenes = new SceneData[1]; //ToDo: Anzahl Scenes setzen !---!---!---!---! for (int i = 0; i < Scenes.Length; i++) Scenes[i] = new SceneData(); //Scenes initialisieren }