public bool NewSecret(Entity entity) { if (entity == null || !entity.IsSecret || !entity.HasTag(GameTag.CLASS)) { return(false); } if (entity.HasCardId) { Exclude(entity.CardId, false); } Secrets.Add(new Secret(entity)); OnSecretsChanged?.Invoke(GetSecretList()); Log.Info(entity.ToString()); return(true); }
public override bool Exclude(string cardId, bool invokeCallback = true) { if (string.IsNullOrEmpty(cardId)) { return(false); } foreach (var secret in Secrets) { secret.Exclude(cardId); } Log.Info("Excluded Secret " + cardId); if (invokeCallback) { OnSecretsChanged?.Invoke(GetSecretList()); } return(true); }
public void Toggle(string cardId) { var excluded = Secrets.Any(s => s.IsExcluded(cardId)); if (excluded) { foreach (var secret in Secrets) { secret.Include(cardId); } } else { Exclude(cardId, false); } OnSecretsChanged?.Invoke(GetSecretList()); }
public bool RemoveSecret(Entity entity) { if (entity == null) { return(false); } var secret = Secrets.FirstOrDefault(s => s.Entity.Id == entity.Id); if (secret != null) { HandleFastCombat(entity); Secrets.Remove(secret); if (secret.Entity.HasCardId) { Exclude(secret.Entity.CardId, false); } OnSecretsChanged?.Invoke(GetSecretList()); return(true); } Log.Info("Secret not found: " + entity); return(false); }
public override void Reset() { base.Reset(); Secrets.Clear(); OnSecretsChanged?.Invoke(new List <Card>()); }
public override void Refresh() { OnSecretsChanged?.Invoke(GetSecretList()); }