public bool Parse(GameState game, GameState.Entity entity) { bool ret = true; ret = this.crystal.Parse(game, entity) && ret; this.fatigue = entity.GetTagOrDefault(GameTag.FATIGUE, 0); this.first_player = (entity.GetTagOrDefault(GameTag.FIRST_PLAYER, 0) != 0); ret = this.enchantments.Parse(game, entity) && ret; if (entity.HasTag(GameTag.HERO_ENTITY) == false) ret = false; else { int hero_entity_id = entity.GetTag(GameTag.HERO_ENTITY); if (game.Entities.ContainsKey(hero_entity_id) == false) ret = false; else { ret = this.hero.Parse(game, game.Entities[hero_entity_id]) && ret; } } ret = this.weapon.Parse(game, entity) && ret; ret = this.secrets.Parse(game, entity) && ret; ret = this.minions.Parse(game, entity) && ret; ret = this.hand.Parse(game, entity) && ret; ret = this.deck.Parse(game, entity) && ret; return ret; }
public bool Parse(GameState game, GameState.Entity entity) { bool ret = true; this.card_id = entity.CardId; if (entity.HasTag(GameTag.CLASS) == false) { this.@class = ""; } else { this.@class = ((TAG_CLASS)entity.GetTag(GameTag.CLASS)).ToString(); } return ret; }