Advertisement
Layvu

OOP1. Домино

Nov 16th, 2022
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace Dominoes
  5. {
  6.     public class Domino
  7.     {
  8.         public int FirstDigit;
  9.         public int SecondDigit;
  10.     }
  11.  
  12.     static class GameMatch
  13.     {
  14.         static Player[] players;
  15.     }
  16.  
  17.     class GameRules
  18.     {
  19.         static string Rules = "";
  20.     }
  21.  
  22.     public class BoxOfDominos
  23.     {
  24.         public Domino[] Deck;
  25.         public int CountDominos => Deck.Length;
  26.     }
  27.  
  28.     class Player
  29.     {
  30.         public string Name;
  31.         public BoxOfDominos Deck;
  32.         public Domino Move(int dominoNumber) => Deck.Deck[dominoNumber];
  33.     }
  34.  
  35.     class Bazaar
  36.     {
  37.         public BoxOfDominos Heap;
  38.         public int CountDominos => Heap.CountDominos;
  39.         public Domino GetRandomDomino()
  40.         {
  41.             int randomNumber = CountDominos - 1;
  42.             return Heap.Deck[randomNumber];
  43.         }
  44.     }
  45.  
  46.     class Table
  47.     {
  48.         public Bazaar Basaar;
  49.         public BoxOfDominos Moves;
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement