Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace CardGame
- {
- enum Marks
- {
- Peaks,
- Worms,
- Crosses,
- Booby
- }
- enum Color
- {
- Red,
- Black
- }
- class Card
- {
- private int _score;
- private Marks _mark;
- private Color _color;
- public Card(int score, Marks mark, Color color)
- {
- if (score < 0 || score > 14)
- throw new ArgumentException();
- _score = score;
- _mark = mark;
- _color = color;
- }
- public int Score { get; }
- public Marks Mark { get; }
- public Color Color { get; }
- }
- static class GameRules
- {
- static private string rules = "";
- static public string Rules
- {
- get { return rules; }
- }
- }
- class Player
- {
- public Player(string name) { _name = name; }
- public string _name { get; private set; }
- public BoxOfCards CountCardsOnHand { get; set; }
- public Card Move(int numberOfCard)
- {
- return CountCardsOnHand.Cards[numberOfCard];
- }
- }
- class GameMatch
- {
- public GameMatch(Marks specialCardMark, params Player[] players)
- {
- SpecialCardMark = specialCardMark;
- foreach (var player in players)
- _players.Add(player);
- }
- public readonly Marks SpecialCardMark;
- static List<Player> _players { get; set; }
- }
- class Table
- {
- public Deck deck;
- public BoxOfCards move1;
- public BoxOfCards move2;
- public BoxOfCards beaten;
- public Deck Deck { get; }
- public BoxOfCards Move1 { get; set; }
- public BoxOfCards Move2 { get; set; }
- public BoxOfCards Beaten { get; }
- }
- class BoxOfCards
- {
- public List<Card> cards;
- public int countCards { get { return cards.Count; } }
- public List<Card> Cards { get; private set; }
- public void AddCards(params Card[] listOfCrds)
- {
- foreach (var i in listOfCrds)
- cards.Add(i);
- }
- }
- class Deck
- {
- public Stack<Card> cards;
- public int CountCards { get { return cards.Count; } }
- public Stack<Card> Cards { get; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement