public Game() { InitGame(); _table = new Table(6, _gameSuit); m = new UserTableManager(_userPlayer, _cpuPlayer, _deck, _gameSuit, _table,1); }
public void UserAction(userActionType action, Card c) { switch (action) { case userActionType.attack: { if (m.Att(c)) { _userPlayer.Hand.Remove(c); if (m.End) { _table.Clear(); m = new UserTableManager(_userPlayer, _cpuPlayer, _deck, _gameSuit, _table,1); } } else { _userPlayer.Hand.Add(c); } break; } case userActionType.defence: { if (!m.End) { if (m.Def(c)) { _userPlayer.Hand.Remove(c); if (_table.isAllDefence()) { _table.Clear(); m = new UserTableManager(_userPlayer, _cpuPlayer, _deck, _gameSuit, _table,0); } }; } else { _table.Clear(); m = new UserTableManager(_userPlayer, _cpuPlayer, _deck, _gameSuit, _table,1); } break; } case userActionType.take: { m.Take(_userPlayer); _table.Clear(); m = new UserTableManager(_userPlayer, _cpuPlayer, _deck, _gameSuit, _table,1); break; } case userActionType.end: { _table.Clear(); m = new UserTableManager(_userPlayer, _cpuPlayer, _deck, _gameSuit, _table,1); break; } } }