public GameData(SerializationInfo info, StreamingContext context) { Player = (PlayerCharacter)info.GetValue("player", typeof(PlayerCharacter)); Combat = (Combat)info.GetValue("combat", typeof(Combat)); //Text = (Text)info.GetValue("text", typeof(Text)); State = (State)info.GetValue("state", typeof(State)); UIPlayerInfo = (UICharacterInfo)info.GetValue("UIPlayerInfo", typeof(UICharacterInfo)); Map = (Map)info.GetValue("map", typeof(Map)); UIEnemyInfo = (UICharacterInfo)info.GetValue("UIEnemyInfo", typeof(UICharacterInfo)); }
public GameData(PlayerCharacter player, Combat combat, State state, Map map, UICharacterInfo uIPlayerInfo, UICharacterInfo uIEnemyInfo) { Player = player; Combat = combat; //Text = text; State = state; Map = map; UIPlayerInfo = uIPlayerInfo; UIEnemyInfo = uIEnemyInfo; }
public void SetCharacterInfo(UICharacterInfo uICharacterInfo) { Name = uICharacterInfo.Name; WeaponName = uICharacterInfo.WeaponName; ArmorName = uICharacterInfo.ArmorName; EffectList = uICharacterInfo.EffectList; HP = uICharacterInfo.HP; MaxHP = uICharacterInfo.MaxHP; Str = uICharacterInfo.Str; Dex = uICharacterInfo.Dex; Int = uICharacterInfo.Int; ArmorDef = uICharacterInfo.ArmorDef; WeaponDmg = uICharacterInfo.WeaponDmg; }
public void UpDatePlayerBox() { //player UI_PlayerName.Content = "Name: " + Game.UIPlayerInfo.Name; UI_PlayerWeapon.Content = "Weapon: " + Game.UIPlayerInfo.WeaponName; UI_PlayerArmor.Content = "Armor: " + Game.UIPlayerInfo.ArmorName; UI_PlayerHP.Content = "Hp: " + Game.UIPlayerInfo.HP; UI_PlayerHpMax.Content = "Hp Max: " + Game.UIPlayerInfo.MaxHP; UI_PlayerDmg.Content = "Dmg: " + Game.UIPlayerInfo.WeaponDmg; UI_PlayerDef.Content = "Def: " + Game.UIPlayerInfo.ArmorDef; UI_PlayerStr.Content = "Str: " + Game.UIPlayerInfo.Str; UI_PlayerDex.Content = "Dex: " + Game.UIPlayerInfo.Dex; UI_PlayerInt.Content = "Int: " + Game.UIPlayerInfo.Int; UICharacterInfo t1 = Game.UIPlayerInfo; UI_PlayerHpBar.Value = UI_PlayerHpBar.Maximum * ((float)Game.UIPlayerInfo.HP / Game.UIPlayerInfo.MaxHP); UI_PlayerXP.Content = "Xp: " + Game.player.xp; UI_PlayerGold.Content = "Gold: " + Game.player.Gold; UI_PlayerStamina.Content = "Stamina: " + Game.player.Stamina; UI_PlayerMana.Content = "Mana: " + Game.player.Mana; switch (Game.UIPlayerInfo.EffectList.Count) { case 1: UI_PlayerDmgEffect1.Content = Game.UIPlayerInfo.EffectList[0].Name + " " + Game.UIPlayerInfo.EffectList[0].EffectLength; break; case 2: UI_PlayerDmgEffect1.Content = Game.UIPlayerInfo.EffectList[0].Name + " " + Game.UIPlayerInfo.EffectList[0].EffectLength; UI_PlayerDmgEffect1.Content = Game.UIPlayerInfo.EffectList[1].Name + " " + Game.UIPlayerInfo.EffectList[1].EffectLength; break; case 3: UI_PlayerDmgEffect1.Content = Game.UIPlayerInfo.EffectList[0].Name + " " + Game.UIPlayerInfo.EffectList[0].EffectLength; UI_PlayerDmgEffect1.Content = Game.UIPlayerInfo.EffectList[1].Name + " " + Game.UIPlayerInfo.EffectList[1].EffectLength; UI_PlayerDmgEffect1.Content = Game.UIPlayerInfo.EffectList[2].Name + " " + Game.UIPlayerInfo.EffectList[2].EffectLength; break; } //Skills UI_PlayerSkillMelee.Content = "Melee: " + Game.player.Skills.Melee["Melee"]; UI_PlayerSkillAxes.Content = "Axes: " + Game.player.Skills.Melee["Axes"]; UI_PlayerSkillDaggers.Content = "Daggers: " + Game.player.Skills.Melee["Daggers"]; UI_PlayerSkillSpears.Content = "Spears: " + Game.player.Skills.Melee["Spears"]; UI_PlayerSkillSwords.Content = "Swords: " + Game.player.Skills.Melee["Swords"]; UI_PlayerSkillUnarmed.Content = "Unarmed: " + Game.player.Skills.Melee["Unarmed"]; // Unamred UI_PlayerSkillRange.Content = "Range: " + Game.player.Skills.Range["Range"]; UI_PlayerSkillBows.Content = "Bows: " + Game.player.Skills.Range["Bows"]; UI_PlayerSkillCrossbows.Content = "Crossbows: " + Game.player.Skills.Range["Crossbows"]; UI_PlayerSkillJavalines.Content = "Javalines: " + Game.player.Skills.Range["Javalines"]; UI_PlayerSkillThrowingWeapons.Content = "Throwing Weapons: " + Game.player.Skills.Range["Throwing Weapons"]; UI_PlayerSkillMagic.Content = "Magic: " + Game.player.Skills.Magic["Magic"]; UI_PlayerSkillSpells.Content = "Spells: " + Game.player.Skills.Magic["Spells"]; }