//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); ((CPictureCollectionAtt)(Attributs)).PictureURLList = new List <PictureList>(); foreach (XmlNode n in xml.SelectNodes("//uri")) { PictureList p = new PictureList(); string strTemp = n.InnerText; if (strTemp != "(none)") { p.PictureURL = path + strTemp; } else { p.PictureURL = "(none)"; } ((CPictureCollectionAtt)(Attributs)).PictureURLList.Add(p); } try { System.Drawing.Bitmap img = new System.Drawing.Bitmap(((CPictureCollectionAtt)Attributs).PictureURLList[0].PictureURL); this.ImgBackground = img; this.Ctrl.BackgroundImage = ImgBackground; } catch { }; Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setMarkerName(xml.SelectSingleNode("//marker").InnerText); }
//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); string strTemp = xml.SelectSingleNode("//uri").InnerText; if (strTemp != "(none)") { ((CPictureAtt)(Attributs)).PictureURL = path + strTemp; } else { ((CPictureAtt)(Attributs)).PictureURL = "(none)"; } Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setMarkerName(xml.SelectSingleNode("//marker").InnerText); try { Bitmap img = new Bitmap(((CPictureAtt)Attributs).PictureURL); this.ImgBackground = img; this.Ctrl.BackgroundImage = ImgBackground; } catch { }; }
public override string toXMLString() { StringBuilder strXML = new StringBuilder(); strXML.Append(@"<object> <type>%type%</type>"); strXML.Replace("%type%", this.getName()); foreach (PictureList s in ((CPictureCollectionAtt)(Attributs)).PictureURLList) { strXML.Append("<uri>" + s.PictureURL + "</uri>"); } if (((CPictureCollectionAtt)(Attributs)).PictureURLList.Count == 0) { strXML.Append("<uri></uri>"); } strXML.Append(@"<x>%x%</x> <y>%y%</y> <width>%width%</width> <height>%height%</height> <marker>%marker%</marker> </object> "); strXML.Replace("%x%", Attributs.getLocation().X.ToString()); strXML.Replace("%y%", Attributs.getLocation().Y.ToString()); strXML.Replace("%width%", Attributs.getSize().Width.ToString()); strXML.Replace("%height%", Attributs.getSize().Height.ToString()); strXML.Replace("%marker%", Attributs.getMarkerName()); return(strXML.ToString()); }
//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); XmlNodeList n = xml.SelectNodes("//uri"); string strTemp = n[0].InnerText; if (strTemp != "(none)") { ((C3DObjectAtt)(Attributs)).Md2URL = path + strTemp; } else { ((C3DObjectAtt)(Attributs)).Md2URL = "(none)"; } strTemp = n[1].InnerText; if (strTemp != "(none") { ((C3DObjectAtt)(Attributs)).TextureURL = path + strTemp; } else { ((C3DObjectAtt)(Attributs)).TextureURL = "(none)"; } Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setMarkerName(xml.SelectSingleNode("//marker").InnerText); }
/// <summary> /// Un objet équipable sur un membre d'un héro /// </summary> /// <param name="Nom">Le nom</param> /// <param name="Description">La description</param> /// <param name="Prix">Le prix de vente</param> /// <param name="Membre">Le membre sur lequel l'objet doit être utilisé</param> /// <param name="ClasseRestreinte">La classe auquel l'objet est restreint</param> public Equipable(string Nom, string Description, double Prix, Attributs Attributs, Membre Membre, ClasseRef ClasseRestreinte = ClasseRef.Tous) : base(Nom, Description, Prix) { _attributs = Attributs; _membre = Membre; _classeRestreinte = ClasseRestreinte; AppliquerConditions(); }
//load đoạn xml từ chỗ <object>... public override void loadfromXML(string strXML, string path) { XmlDocument xml = new XmlDocument(); xml.LoadXml(strXML); Attributs.setLocation(new Point(int.Parse(xml.SelectSingleNode("//x").InnerText), int.Parse(xml.SelectSingleNode("//y").InnerText))); Attributs.setSize(new Size(int.Parse(xml.SelectSingleNode("//width").InnerText), int.Parse(xml.SelectSingleNode("//height").InnerText))); Attributs.setInstanceName(xml.SelectSingleNode("//name").InnerText); }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); ((CAudioAtt)(Attributs)).AudioURL = ((CAudioAtt)(control.getAttList())).AudioURL; /*try * { * Bitmap img = new Bitmap(((CAudioAtt)(Attributs)).AudioURL); * ImgBackground = img; * Ctrl.BackgroundImage = ImgBackground; * } * catch { };*/ }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); ((C3DObjectAtt)(Attributs)).Md2URL = ((C3DObjectAtt)(control.getAttList())).Md2URL; ((C3DObjectAtt)(Attributs)).TextureURL = ((C3DObjectAtt)(control.getAttList())).TextureURL; try { Bitmap img = new Bitmap(((C3DObjectAtt)(Attributs)).TextureURL); ImgBackground = img; Ctrl.BackgroundImage = ImgBackground; } catch { }; }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); //((CMarkerAtt)(Attributs)).MarkerURL = ((CMarkerAtt)(control.getAttList())).MarkerURL; //try //{ // Bitmap img = new Bitmap(((CMarkerAtt)(Attributs)).MarkerURL); // ImgBackground = img; // Ctrl.BackgroundImage = ImgBackground; //} //catch { // loadBackgroundAndICO(); // Ctrl.BackgroundImage = ImgBackground; //}; }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); ((CVideoAtt)(Attributs)).VideoURL = ((CVideoAtt)(control.getAttList())).VideoURL; try { Bitmap img = new Bitmap(((CVideoAtt)(Attributs)).VideoURL); ImgBackground = img; Ctrl.BackgroundImage = ImgBackground; } catch { loadBackgroundAndICO(); Ctrl.BackgroundImage = ImgBackground; }; }
public override string toXMLString() { StringBuilder strXML = new StringBuilder(); strXML.Append(@"<marker> <name>%name%</name> <x>%x%</x> <y>%y%</y> <width>%width%</width> <height>%height%</height> </marker> "); strXML.Replace("%name%", this.getAttList().getInstanceName()); strXML.Replace("%x%", Attributs.getLocation().X.ToString()); strXML.Replace("%y%", Attributs.getLocation().Y.ToString()); strXML.Replace("%width%", Attributs.getSize().Width.ToString()); strXML.Replace("%height%", Attributs.getSize().Height.ToString()); return(strXML.ToString()); }
public override void copy(INewsPaperControl control) { Attributs.setLocation(control.getAttList().getLocation()); Attributs.setSize(control.getAttList().getSize()); foreach (PictureList p in ((CPictureCollectionAtt)control.getAttList()).PictureURLList) { ((CPictureCollectionAtt)Attributs).PictureURLList.Add(p); } try { System.Drawing.Bitmap img = new System.Drawing.Bitmap(((CPictureCollectionAtt)Attributs).PictureURLList[0].PictureURL); ImgBackground = img; Ctrl.BackgroundImage = ImgBackground; } catch { loadBackgroundAndICO(); Ctrl.BackgroundImage = ImgBackground; }; }
public StatusWindow(Texture2D tex, Vector2 pos, string karakterName, int intelligence, int strength, int agility, int vitality, int luck, float hp, float mana, int lvl, PlayerIndex playerIndex) : base(tex, pos) { this.karakterName = karakterName; this.intelligence = intelligence; this.strength = strength; this.agility = agility; this.vitality = vitality; this.luck = luck; this.hp = hp; this.maxHp = hp; this.mana = mana; this.maxMana = mana; this.lvl = lvl; this.money = 0; this.playerIndex = playerIndex; this.points = 100; this.Selectedattributs = Attributs.intelligence; color = new Color(255, 255, 255, 0.75f); }
public void updateAttributeValueBase(string strAttName, object objAttValue) { switch (strAttName) { case "YLocation": Attributs.setLocation(new Point(Attributs.getLocation().X, (int)objAttValue)); break; case "XLocation": Attributs.setLocation(new Point((int)objAttValue, Attributs.getLocation().Y)); break; case "Width": Attributs.setSize(new Size((int)objAttValue, Attributs.getSize().Height)); break; case "Height": Attributs.setSize(new Size(Attributs.getSize().Width, (int)objAttValue)); ctrl.Invalidate(); break; } }
public override string toXMLString() { StringBuilder strXML = new StringBuilder(); strXML.Append(@"<object> <type>%type%</type> <uri>%uri%</uri> <x>%x%</x> <y>%y%</y> <width>%width%</width> <height>%height%</height> <marker>%marker%</marker> </object> "); strXML.Replace("%type%", this.getName()); strXML.Replace("%uri%", ((CVideoAtt)(Attributs)).VideoURL); strXML.Replace("%x%", Attributs.getLocation().X.ToString()); strXML.Replace("%y%", Attributs.getLocation().Y.ToString()); strXML.Replace("%width%", Attributs.getSize().Width.ToString()); strXML.Replace("%height%", Attributs.getSize().Height.ToString()); strXML.Replace("%marker%", Attributs.getMarkerName()); return(strXML.ToString()); }
/// <summary> /// Le squelette d'un constructeur de Classe de personnage /// </summary> /// <param name="Nom">Le nom de la Classe</param> /// <param name="Description">La description de la Classe</param> public Classe(string Nom, string Description, Attributs Attributs) { _nom = Nom; _description = Description; _attributsDeBase = Attributs; }
/// <summary> /// Créée un nouveau héro /// </summary> /// <param name="Nom">Le nom</param> /// <param name="Classe">La classe</param> /// <param name="Niveau">Le niveau d'expérience</param> /// <param name="PointsDeVie">Le nombre de points de vie</param> /// <param name="PointsDeVieBase">Le nombre de points de vie maximum</param> /// <param name="Courage">Le courage (ou l'initiative)</param> /// <param name="Precision">La précision</param> /// <param name="Esquive">L'esquive</param> /// <param name="Force">La force</param> /// <param name="Defense">La défense</param> public Hero(string Nom, Classe Classe, int Niveau, int PointsDeVie, Attributs Attributs) : base(Nom, Classe, Etat.Normal, Niveau, PointsDeVie, Attributs) { _equipement = new Equipement(); _experience = 0; }
/// <summary> /// Créée un nouvel ennemi /// </summary> /// <param name="Nom">Le nom</param> /// <param name="Etat">L'état de conscience actuel</param> /// <param name="Niveau">Le niveau d'expérience</param> /// <param name="PointsDeVie">Le nombre de points de vie</param> public Ennemi(string Nom, Classe Classe, int Niveau, Attributs Attributs) : base(Nom, Classe, Etat.Normal, Niveau, Attributs.PointsDeVieBase, Attributs) { }
public override void Update(GameTime gameTime) { gamePadState = GamePad.GetState(playerIndex); if (active == true) { #region Select attribut switch (Selectedattributs) { case Attributs.intelligence: #region intelligence colorint = Color.Red; if (gamePadState.DPad.Up == ButtonState.Pressed && oldgamePadState.DPad.Up == ButtonState.Released) { this.colorint = Color.Black; Selectedattributs = Attributs.luck; } if (gamePadState.DPad.Down == ButtonState.Pressed && oldgamePadState.DPad.Down == ButtonState.Released) { this.colorint = Color.Black; Selectedattributs = Attributs.strength; } if (gamePadState.Buttons.A == ButtonState.Pressed && oldgamePadState.Buttons.A == ButtonState.Released) { if (points > 0) { intelligence++; points--; maxMana += intelligence; } } #endregion break; case Attributs.strength: #region strength colorstr = Color.Red; if (gamePadState.DPad.Up == ButtonState.Pressed && oldgamePadState.DPad.Up == ButtonState.Released) { colorstr = Color.Black; Selectedattributs = Attributs.intelligence; } if (gamePadState.DPad.Down == ButtonState.Pressed && oldgamePadState.DPad.Down == ButtonState.Released) { colorstr = Color.Black; Selectedattributs = Attributs.agility; } if (gamePadState.Buttons.A == ButtonState.Pressed && oldgamePadState.Buttons.A == ButtonState.Released) { if (points > 0) { strength++; points--; } } #endregion break; case Attributs.agility: #region agility coloragili = Color.Red; if (gamePadState.DPad.Up == ButtonState.Pressed && oldgamePadState.DPad.Up == ButtonState.Released) { coloragili = Color.Black; Selectedattributs = Attributs.strength; } if (gamePadState.DPad.Down == ButtonState.Pressed && oldgamePadState.DPad.Down == ButtonState.Released) { coloragili = Color.Black; Selectedattributs = Attributs.vitality; } if (gamePadState.Buttons.A == ButtonState.Pressed && oldgamePadState.Buttons.A == ButtonState.Released) { if (points > 0) { agility++; points--; } } #endregion break; case Attributs.vitality: #region vitality colorvitality = Color.Red; if (gamePadState.DPad.Up == ButtonState.Pressed && oldgamePadState.DPad.Up == ButtonState.Released) { colorvitality = Color.Black; Selectedattributs = Attributs.agility; } if (gamePadState.DPad.Down == ButtonState.Pressed && oldgamePadState.DPad.Down == ButtonState.Released) { colorvitality = Color.Black; Selectedattributs = Attributs.luck; } if (gamePadState.Buttons.A == ButtonState.Pressed && oldgamePadState.Buttons.A == ButtonState.Released) { if (points > 0) { vitality++; points--; maxHp += vitality; } } #endregion break; case Attributs.luck: #region luck colorluck = Color.Red; if (gamePadState.DPad.Up == ButtonState.Pressed && oldgamePadState.DPad.Up == ButtonState.Released) { colorluck = Color.Black; Selectedattributs = Attributs.vitality; } if (gamePadState.DPad.Down == ButtonState.Pressed && oldgamePadState.DPad.Down == ButtonState.Released) { colorluck = Color.Black; Selectedattributs = Attributs.intelligence; } if (gamePadState.Buttons.A == ButtonState.Pressed && oldgamePadState.Buttons.A == ButtonState.Released) { if (points > 0) { luck++; points--; } } #endregion break; } #endregion } oldgamePadState = GamePad.GetState(playerIndex); }