public void UpdateSpecialRules() { specialRules = ETriadGameSpecialMod.None; modFeatures = TriadGameModifier.EFeature.None; foreach (TriadGameModifier mod in modifiers) { specialRules |= mod.GetSpecialRules(); modFeatures |= mod.GetFeatures(); } }
public TriadGameData() { board = new TriadCardInstance[boardSize * boardSize]; typeMods = new int[Enum.GetNames(typeof(ETriadCardType)).Length]; state = ETriadGameState.InProgressBlue; resolvedSpecial = ETriadGameSpecialMod.None; numCardsPlaced = 0; numRestarts = 0; bDebugRules = false; for (int Idx = 0; Idx < typeMods.Length; Idx++) { typeMods[Idx] = 0; } }
public TriadGameData(TriadGameData copyFrom) { board = new TriadCardInstance[copyFrom.board.Length]; for (int Idx = 0; Idx < board.Length; Idx++) { board[Idx] = (copyFrom.board[Idx] == null) ? null : new TriadCardInstance(copyFrom.board[Idx]); } typeMods = new int[copyFrom.typeMods.Length]; for (int Idx = 0; Idx < typeMods.Length; Idx++) { typeMods[Idx] = copyFrom.typeMods[Idx]; } deckBlue = copyFrom.deckBlue.CreateCopy(); deckRed = copyFrom.deckRed.CreateCopy(); state = copyFrom.state; numCardsPlaced = copyFrom.numCardsPlaced; numRestarts = copyFrom.numRestarts; resolvedSpecial = copyFrom.resolvedSpecial; // bDebugRules not copied, only first step needs it }
public void ResolveSpecialRule(ETriadGameSpecialMod specialMod) { GameState.resolvedSpecial |= specialMod; OnGameStateChanged?.Invoke(GameState, null); }