// Конструктор - создание по ID и основному игровому объекту public Player(Game game, int Id) { this.Game = game; Statistics = new Statistics(); Profile = new Profile(); if (Id >= 0) { ReadPlayerFromDataBase("ID", Id); } }
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(); }
// Конструктор с инициализацией всех объектов 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(); }
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(); }
public Table(Game Game, ClientMan Creator) : this(Game, Creator, Constants.GAME_MINIMAL_BET, true, true, 0, true, false, false, true) { }
public TablesList(Game Game) { game = Game; tables = new List<Table>(); }
public Player(Game game) : this(game, -1) { }
public ClientsList(Game Game) { this.game = Game; clients = new List<ClientMan>(); }
public Autorization(Game game) { this.game = game; }
public Server(Game game) { this.Game = game; Clients = new ClientsList(game); }