// コンストラクタ /// <summary> /// XmlNode を指定して、HtmlElement クラスのインスタンスを開始します。 /// </summary> public HtmlElement(XmlElement e) : base(e){ myNote = e.GetInnerText(HatomaruHtmlRef.NoteElementName); myNoteJa = e.GetInnerText(HatomaruHtmlRef.NoteJaElementName); string omitStr = e.GetInnerText(HatomaruHtmlRef.OmitElementName); if(omitStr != null && omitStr.Length == 2){ myOmitStartTag = omitStr[0] == 'o'; myOmitEndTag = omitStr[1] == 'o'; } }
// コンストラクタ /// <summary> /// XmlNode を指定して、HtmlElement クラスのインスタンスを開始します。 /// </summary> public HtmlAttribute(XmlElement e) : base(e){ myNote = e.GetInnerText(HatomaruHtmlRef.NoteElementName); myDefault = e.GetInnerText(HatomaruHtmlRef.DefaultElementName); myFor = e.GetAttributeValue(HatomaruHtmlRef.ForAttributeName); if(string.IsNullOrEmpty(myId)){ myId = myName; if(!string.IsNullOrEmpty(myFor)) myId += IdSeparator + myFor; } }
internal GameAchievement(long steamid64, int appid, XmlElement data) { SteamID64 = steamid64; AppID = appid; Data = data; Name = data.GetInnerText("name"); Unlocked = data.Attributes["closed"] != null; if (data.GetElementsByTagName("unlockTimestamp").Count > 0) Timestamp = new DateTime(Convert.ToInt32(data.GetInnerText("unlockTimestamp"))); }
// publicメソッド // XmlElementからAmazonItemのプロパティをロードします。 public void Load(XmlElement itemElement){ if(itemElement.Name != ItemElementName){ throw new ArgumentException("AmazonItemをロードしようとしましたが、Item要素が渡されませんでした。要素名:" + itemElement.Name); } this.Asin = itemElement.GetInnerText(AsinElementName); this.DetailPageUrl = itemElement.GetInnerText(DetailPageUrlElementName); XmlElement attrElement = itemElement[ItemAttributesElementName]; if(attrElement != null){ this.Title = attrElement.GetInnerText(TitleElementName); } XmlNodeList imageElements = itemElement.GetElementsByTagName(ImageElementName); if(imageElements.Count > 0) this.Image = new AmazonImage(imageElements[0] as XmlElement); }
public TF2Class(XmlElement data) : base(data) { MaxBuildingsDestroyed = int.Parse(data.GetInnerText("ibuildingsdestroyed")); MaxCaptures = int.Parse(data.GetInnerText("ipointcaptures")); MaxDamage = int.Parse(data.GetInnerText("idamagedealt")); MaxDefenses = int.Parse(data.GetInnerText("ipointdefenses")); MaxDominations = int.Parse(data.GetInnerText("idominations")); MaxKillAssists = int.Parse(data.GetInnerText("ikillassists")); MaxKills = int.Parse(data.GetInnerText("inumberofkills")); MaxRevenges = int.Parse(data.GetInnerText("irevenge")); MaxScore = int.Parse(data.GetInnerText("ipointsscored")); MaxTimeAlive = int.Parse(data.GetInnerText("iplaytime")); }
public L4DFavourite(XmlElement data) { Campaign = data.GetInnerText("campaign"); CampaignPercentage = int.Parse(data.GetInnerText("campaignpct")); Character = data.GetInnerText("character"); CharacterPercentage = int.Parse(data.GetInnerText("characterpct")); Level1Weapon = data.GetInnerText("weapon1"); Level1WeaponPercentage = int.Parse(data.GetInnerText("weapon1pct")); Level2Weapon = data.GetInnerText("weapon2"); Level2WeaponPercentage = int.Parse(data.GetInnerText("weapon2pct")); }
public TF2Spy(XmlElement data) : base(data) { MaxBackstabs = int.Parse(data.GetInnerText("ibackstabs")); MaxHealthLeeched = int.Parse(data.GetInnerText("ihealthpointsleached")); }
public L4D2ScavengeStats(XmlElement data) { AverageCansPerRound = float.Parse(data.GetInnerText("avgcansperround")); PerfectRounds = int.Parse(data.GetInnerText("perfect16canrounds")); RoundsLost = int.Parse(data.GetInnerText("roundslost")); RoundsPlayed = int.Parse(data.GetInnerText("roundsplayed")); RoundsWon = int.Parse(data.GetInnerText("roundswon")); TotalCans = int.Parse(data.GetInnerText("totalcans")); List<L4D2ScavengeMapStats> mapList = new List<L4D2ScavengeMapStats>(); foreach (XmlElement map in data.GetXmlElement("mapstats")) { mapList.Add(new L4D2ScavengeMapStats(map)); } MapStats = mapList.ToArray(); }
public DoDSClass(XmlElement data) { Key = data.GetAttribute("key"); Name = data.GetInnerText("name"); Blocks = int.Parse(data.GetInnerText("blocks")); BombsDefused = int.Parse(data.GetInnerText("bombsdefused")); BombsPlanted = int.Parse(data.GetInnerText("bombsplanted")); Captures = int.Parse(data.GetInnerText("captures")); Deaths = int.Parse(data.GetInnerText("deaths")); Dominations = int.Parse(data.GetInnerText("dominations")); Kills = int.Parse(data.GetInnerText("kills")); RoundsLost = int.Parse(data.GetInnerText("roundslost")); RoundsWon = int.Parse(data.GetInnerText("roundswon")); RoundsLost = int.Parse(data.GetInnerText("roundslost")); Revenges = int.Parse(data.GetInnerText("revenges")); PlayTime = int.Parse(data.GetInnerText("playtime")); }
public AlienSwarmFavorites(XmlElement data) { Class = data.GetInnerText("class"); ClassImage = data.GetInnerText("classimg"); ClassPercentage = float.Parse(data.GetInnerText("classpct")); Difficulty = data.GetInnerText("difficulty"); DifficultyPercentage = float.Parse(data.GetInnerText("difficultypct")); Extra = data.GetInnerText("extra"); ExtraImage = data.GetInnerText("extraimg"); ExtraPercentage = float.Parse(data.GetInnerText("extrapct")); Marine = data.GetInnerText("marine"); MarineImage = data.GetInnerText("marineimg"); MarinePercentage = float.Parse(data.GetInnerText("marinepct")); Mission = data.GetInnerText("mission"); MissionImage = data.GetInnerText("missionimg"); MissionPercentage = float.Parse(data.GetInnerText("missionpct")); PrimaryWeapon = data.GetInnerText("primary"); PrimaryWeaponImage = data.GetInnerText("primaryimg"); PrimaryWeaponPercentage = float.Parse(data.GetInnerText("primarypct")); SecondaryWeapon = data.GetInnerText("secondary"); SecondaryWeaponImage = data.GetInnerText("secondaryimg"); SecondaryWeaponPercentage = float.Parse(data.GetInnerText("secondarypct")); }
public AlienSwarmWeapon(XmlElement data) : base(data) { Accuracy = float.Parse(data.GetInnerText("accuracy")); Damage = int.Parse(data.GetInnerText("damage")); FriendlyFire = int.Parse(data.GetInnerText("friendlyfire")); Name = data.GetInnerText("name"); Shots = int.Parse(data.GetInnerText("shotsfired")); }
public CSSLastMatchStats(XmlElement data) { CostPerKill = float.Parse(data.GetInnerText("costkill")); CTWins = int.Parse(data.GetInnerText("ct_wins")); Damage = int.Parse(data.GetInnerText("dmg")); Deaths = int.Parse(data.GetInnerText("deaths")); Dominations = int.Parse(data.GetInnerText("dominations")); FavoriteWeapon = int.Parse(data.GetInnerText("favwpnid")); Kills = int.Parse(data.GetInnerText("kills")); MaxPlayers = int.Parse(data.GetInnerText("max_players")); Money = int.Parse(data.GetInnerText("money")); Revenges = int.Parse(data.GetInnerText("revenges")); Stars = int.Parse(data.GetInnerText("stars")); TWins = int.Parse(data.GetInnerText("t_wins")); Wins = int.Parse(data.GetInnerText("wins")); if (Deaths == 0) KDRatio = 0; else KDRatio = Kills / Deaths; }
public CSSWeapon(string weaponname, XmlElement data) { Name = weaponname; if ((Name != "grenade") && (Name != "knife")) { Favorite = data.GetInnerText("favorite").Equals(Name); Kills = int.Parse(data.GetInnerText(Name + "_kills")); Shots = int.Parse(data.GetInnerText(Name + "_shots")); if (Shots != 0) { Accuracy = Hits / Shots; KSRatio = Kills / Shots; } else { Accuracy = 0; KSRatio = 0; } } }
public L4DTeamPlayStats(XmlElement data) { Revived = int.Parse(data.GetInnerText("revived")); MostRevivedDifficulty = data.GetInnerText("reviveddiff"); AverageRevived = float.Parse(data.GetInnerText("revivedavg")); AverageWasRevived = float.Parse(data.GetInnerText("wasrevivedavg")); Protected = int.Parse(data.GetInnerText("protected")); MostProtectedDifficulty = data.GetInnerText("protecteddiff"); AverageProtected = float.Parse(data.GetInnerText("protectedavg")); AverageWasProtected = float.Parse(data.GetInnerText("wasprotectedavg")); FriendlyFireDamage = int.Parse(data.GetInnerText("ffdamage")); MostFriendlyFireDamageDifficulty = data.GetInnerText("ffdamagediff"); AverageFriendlyFireDamage=float.Parse(data.GetInnerText("ffdamageavg")); }
public CSSMap(string mapname, XmlElement data) { Name = mapname; Favorite = data.GetInnerText("favorite").Equals(Name); RoundsPlayed = int.Parse(data.GetInnerText(Name + "_rounds")); RoundsWon = int.Parse(data.GetInnerText(Name + "_wins")); RoundsLost = RoundsPlayed - RoundsWon; RoundsWonPercentage = (RoundsPlayed > 0) ? ((float)RoundsWon / RoundsPlayed) : 0; }
public L4DSurvivalStats(XmlElement data) { GoldMedals = int.Parse(data.GetInnerText("goldmedals")); SolverMedals = int.Parse(data.GetInnerText("silvermedals")); BronzeMedals = int.Parse(data.GetInnerText("bronzemedals")); RoundsPlayed = int.Parse(data.GetInnerText("roundsplayed")); BestTime = float.Parse(data.GetInnerText("besttime")); }
public L4DMostRecentGame(XmlElement data) { Difficulty = data.GetInnerText("difficulty"); Escaped = data.GetInnerText("bEscaped").Equals("1"); Movie = data.GetInnerText("movie"); // TODO: check this out, maybe it's because i didn't played for a long time TimePlayed = data.GetInnerText("time"); }
public L4DMap(XmlElement data) { ID = data.Name; Name = data.GetInnerText("name"); BestTime = float.Parse(data.GetInnerText("besttimeseconds")); Medal = MedalFrom(data.GetInnerText("medal")); }
/// <summary> /// Factory method /// </summary> public static TF2Class Create(XmlElement data) { switch (data.GetInnerText("className")) { case "Engineer": return new TF2Engineer(data); case "Medic": return new TF2Medic(data); case "Sniper": return new TF2Sniper(data); case "Spy": return new TF2Spy(data); default: return new TF2Class(data); } }
public HtmlVersionItem(XmlElement e) : base(e){ string verStr = e.GetInnerText(HatomaruHtmlRef.VersionElementName); if(!string.IsNullOrEmpty(verStr)) myVersion = (HtmlVersions)Enum.Parse(typeof(HtmlVersions), verStr, true); }
public AlienSwarmMission(XmlElement data) { AverageDamageTaken = float.Parse(data.GetInnerText("damagetakenavg")); AverageFriendlyFire = float.Parse(data.GetInnerText("friendlyfireavg")); AverageKills = float.Parse(data.GetInnerText("killsavg")); BestDifficulty = data.GetInnerText("bestdifficulty"); DamageTaken = int.Parse(data.GetInnerText("damagetaken")); FriendlyFire = int.Parse(data.GetInnerText("friendlyfire")); GamesSuccessful = int.Parse(data.GetInnerText("gamessuccess")); Image = AlienSwarmStats.AppUrl + data.GetInnerText("image"); Kills = int.Parse(data.GetInnerText("kills")); MapName = /* get node name */ ""; Name = data.GetInnerText("name"); TotalGames = int.Parse(data.GetInnerText("gamestotal")); TotalGamesPercentage = float.Parse(data.GetInnerText("gamestotalpct")); MissionTimes = new AlienSwarmMissionTimes(data); }
// コンストラクタ /// <summary> /// XmlNode を指定して、Topic クラスのインスタンスを開始します。 /// </summary> public HtmlData(XmlElement e) : base(e){ myNameJa = e.GetInnerText(HatomaruHtmlRef.NameJaElementName); }
public AlienSwarmMissionTimes(XmlElement data) { Average = data.GetInnerText("avgtime"); Total = data.GetInnerText("totaltime"); Easy = data.GetInnerText("easytime"); Normal = data.GetInnerText("normaltime"); Hard = data.GetInnerText("hardtime"); Brutal = data.GetInnerText("brutaltime"); Insane = data.GetInnerText("insanetime"); }
public L4D2Weapon(XmlElement data) : base(data) { Damage = data.GetInnerText("pctkills"); WeaponGroup = data.Attributes["group"].InnerText; KillPercentage = ParsePercentage(data.GetInnerText("pctkills")); }
public AlienSwarmWeaponStats(XmlElement data) { AmmoDeployed = int.Parse(data.GetInnerText("ammo_deployed")); SentryGunsDeployed = int.Parse(data.GetInnerText("sentryguns_deployed")); SentryFlamersDeployed = int.Parse(data.GetInnerText("sentry_flamers_deployed")); SentryFreezeDeployed = int.Parse(data.GetInnerText("sentry_freeze_deployed")); SentryCannonDeployed = int.Parse(data.GetInnerText("sentry_cannon_deployed")); MedkitsUsed = int.Parse(data.GetInnerText("medkits_used")); FlaresUsed = int.Parse(data.GetInnerText("flares_used")); AdrenalineUsed = int.Parse(data.GetInnerText("adrenaline_used")); TeslaTrapsDeployed = int.Parse(data.GetInnerText("tesla_traps_deployed")); FreezeGrenadesThrown = int.Parse(data.GetInnerText("freeze_grenades_thrown")); ElectricArmorUsed = int.Parse(data.GetInnerText("electric_armor_used")); HealgunHeals = int.Parse(data.GetInnerText("healgun_heals")); HealgunHealsSelf = int.Parse(data.GetInnerText("healgun_heals_self")); HealbeaconHeals = int.Parse(data.GetInnerText("healbeacon_heals")); HealbeaconHealsSelf = int.Parse(data.GetInnerText("healbeacon_heals_self")); DamageAmpsUsed = int.Parse(data.GetInnerText("damage_amps_used")); HealbeaconsDeployed = int.Parse(data.GetInnerText("healbeacons_deployed")); HealgunHealsPercentage = float.Parse(data.GetInnerText("healgun_heals_pct")); HealgunHealsSelfPercentage = float.Parse(data.GetInnerText("healbeacon_heals_pct_self")); HealbeaconHealsPercentage = float.Parse(data.GetInnerText("healbeacon_heals_pct")); HealbeaconHealsSelfPercentage = float.Parse(data.GetInnerText("healbeacon_heals_pct_self")); }
public TF2Medic(XmlElement data) : base(data) { MaxHealthHealed = int.Parse(data.GetInnerText("ihealthpointshealed")); MaxUeberCharges = int.Parse(data.GetInnerText("inuminvulnerable")); }
public DoDSWeapon(XmlElement data) : base(data) { ID = data.GetAttribute("key"); Name = data.GetInnerText("name"); Headshots = int.Parse(data.GetInnerText("headshots")); Shots = int.Parse(data.GetInnerText("shotsfired")); Hits = int.Parse(data.GetInnerText("shotshit")); }
public TF2Sniper(XmlElement data) : base(data) { MaxHeadShots = int.Parse(data.GetInnerText("iheadshots")); }
public TF2Engineer(XmlElement data) : base(data) { MaxBuildingsBuild = int.Parse(data.GetInnerText("ibuildingsbuilt")); MaxSentryKills = int.Parse(data.GetInnerText("isentrykills")); MaxTeleports = int.Parse(data.GetInnerText("inumteleports")); }
public L4DExplosive(XmlElement data) : base(data) { ID = data.Name; Shots = int.Parse(data.GetInnerText("thrown")); }