public bool TryGetPlayerHeroPowerEntity(int hero_entity_id, out ReadOnlyEntity out_entity) { foreach (var entity in this.entities_.Items) { if (!entity.Value.HasTag(GameTag.CREATOR)) { continue; } if (entity.Value.GetTag(GameTag.CREATOR) != hero_entity_id) { continue; } if (!entity.Value.HasTag(GameTag.CARDTYPE)) { continue; } if (entity.Value.GetTag(GameTag.CARDTYPE) != (int)TAG_CARDTYPE.HERO_POWER) { continue; } out_entity = entity.Value; return(true); } out_entity = null; return(false); }
public ReadOnlyEntity(ReadOnlyEntity rhs) { Id = rhs.Id; Tags = new Dictionary <GameTag, int>(rhs.Tags); Name = rhs.Name; CardId = rhs.CardId; }
public bool TryGetOpponentEntity(out ReadOnlyEntity entity) { if (!this.entities_.Items.ContainsKey(this.OpponentEntityId)) { entity = null; return(false); } entity = this.entities_.Items[this.OpponentEntityId]; return(true); }
public bool TryGetGameEntity(out ReadOnlyEntity entity) { if (this.GameEntityId < 0) { entity = null; return(false); } entity = entities_.Items[this.GameEntityId]; return(true); }