예제 #1
0
 // Конструктор - создание по ID и основному игровому объекту
 public Player(Game game, int Id)
 {
     this.Game = game;
     Statistics = new Statistics();
     Profile = new Profile();
     if (Id >= 0)
     {
         ReadPlayerFromDataBase("ID", Id);
     }
 }
예제 #2
0
 static void Main(string[] args)
 {
     #if DEBUG
     Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
     //Debug.Listeners.Add(new TextWriterTraceListener("Log.txt"));
     Debug.AutoFlush = true;
     Debug.IndentSize = 4;
     Debug.WriteLine(DateTime.Now.ToString() + " Start Server");
     #endif
     Game belote = new Game();
 }
예제 #3
0
 // Конструктор с инициализацией всех объектов
 public ClientMan(TcpClient tcpClient, Game game)
 {
     #if DEBUG
     Debug.WriteLine(DateTime.Now.ToString() + " Подключение нового клиента");
     Debug.Indent();
     Debug.WriteLine("Client IP: " + ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString());
     Debug.Unindent();
     #endif
     client = tcpClient;
     this.game = game;
     Player = null;
     ActiveTable = null;
     ActivePlace = -1;
     // Обработка нового клиента происходит в отдельном потоке
     worker = new Thread(Process);
     worker.Start();
 }
예제 #4
0
 public Table(Game Game, ClientMan Creator, int Bet, bool PlayersVisibility, bool Chat, int MinimalLevel, bool TableVisibility, bool VIPOnly, bool Moderation, bool AI)
 {
     this.game = Game;
     Status = TableStatus.CREATING;
     TableCreator = Creator;
     this.Bet = Bet;
     this.PlayersVisibility = PlayersVisibility;
     this.Chat = Chat;
     this.MinimalLevel = MinimalLevel;
     this.TableVisibility = TableVisibility;
     this.VIPOnly = VIPOnly;
     this.Moderation = Moderation;
     this.AI = AI;
     // ID стол получает только после записи в БД
     this.ID = -1;
     startedPlayer = 1;
     distributions = new DistributionsList();
     CreateTableInDatabase();
 }
예제 #5
0
 public Table(Game Game, ClientMan Creator)
     : this(Game, Creator, Constants.GAME_MINIMAL_BET, true, true, 0, true, false, false, true)
 {
 }
예제 #6
0
 public TablesList(Game Game)
 {
     game = Game;
     tables = new List<Table>();
 }
예제 #7
0
 public Player(Game game)
     : this(game, -1)
 {
 }
예제 #8
0
 public ClientsList(Game Game)
 {
     this.game = Game;
     clients = new List<ClientMan>();
 }
예제 #9
0
 public Autorization(Game game)
 {
     this.game = game;
 }
예제 #10
0
 public Server(Game game)
 {
     this.Game = game;
     Clients = new ClientsList(game);
 }