コード例 #1
0
ファイル: Client.cs プロジェクト: HaKDMoDz/circle-of-current
        private void receiveGameList()
        {
            lobbyTunnel.Send("requestroomlist");
            rooms.Clear();
            listView1.Items.Clear();
            while (true)
            {
                string tmp;
                lobbyTunnel.Receive(out tmp);
                if (tmp == "endaddgame")
                {
                    listView1.Columns[0].Width = listView1.Width * 5 / 100;
                    listView1.Columns[1].Width = listView1.Width * 59 / 100;
                    listView1.Columns[2].Width = listView1.Width * 15 / 100;
                    listView1.Columns[3].Width = listView1.Width * 20 / 100;
                    return;
                }
                else
                {
                    GameListEntry gle  = new GameListEntry();
                    string[]      game = tmp.Split(',');

                    if (game.Length == 4)
                    {
                        gle.gameID      = game[0];
                        gle.gameName    = game[1];
                        gle.playerCount = game[2];
                        gle.totalChips  = game[3];
                        rooms.Add(gle);
                        ListViewItem lvi = new ListViewItem(game);
                        listView1.Items.Add(lvi);
                    }
                }
            }
        }
コード例 #2
0
        public GameManagementViewModel(IGameManagementModel model)
        {
            _model = model;
            _entry = _model.GetEntry();

            SaveGameCommand = new RelayCommand(param => SaveGame());
            CancelCommand   = new RelayCommand(param => Cancel());
        }
コード例 #3
0
ファイル: MasterWindow.cs プロジェクト: seanth/ksp_ris
        private void PlayerList()
        {
            GUILayout.Label("Players in game " + selectedGame, headingStyle);
            GameListEntry gle = server.gameList[selectedGame];

            foreach (string player in gle.players)
            {
                GUILayout.Label(player);
            }
        }
コード例 #4
0
        public static void AddGameListEntry(GameListEntry entry)
        {
            SectionData GameData = new SectionData(entry.TitleID);

            if (entry.AppName != null)
            {
                KeyData AppName = new KeyData("AppName")
                {
                    Value = entry.AppName
                };
                GameData.Keys.SetKeyData(AppName);
            }

            if (entry.Publisher != null)
            {
                KeyData Publisher = new KeyData("Publisher")
                {
                    Value = entry.Publisher
                };
                GameData.Keys.SetKeyData(Publisher);
            }

            if (entry.TitleID != null)
            {
                KeyData TitleID = new KeyData("TitleID")
                {
                    Value = entry.TitleID
                };
                GameData.Keys.SetKeyData(TitleID);
            }

            if (entry.GamePath != null)
            {
                KeyData GamePath = new KeyData("GamePath")
                {
                    Value = entry.GamePath
                };
                GameData.Keys.SetKeyData(GamePath);
            }

            GameListData.Sections.Add(GameData);
            Parser.WriteFile("./Gamelist.ini", GameListData);

            Games = GetAllEntrysFromINI();
        }
コード例 #5
0
        private void receiveGameList()
        {
            lobbyTunnel.Send("requestroomlist");
            rooms.Clear();
            listView1.Items.Clear();
            while (true)
            {
                string tmp;
                lobbyTunnel.Receive(out tmp);
                if (tmp == "endaddgame")
                {
                    listView1.Columns[0].Width = listView1.Width * 5 / 100;
                    listView1.Columns[1].Width = listView1.Width * 59 / 100;
                    listView1.Columns[2].Width = listView1.Width * 15 / 100;
                    listView1.Columns[3].Width = listView1.Width * 20 / 100;
                    return;
                }
                else
                {
                    GameListEntry gle = new GameListEntry();
                    string[] game = tmp.Split(',');

                    if (game.Length == 4)
                    {
                        gle.gameID = game[0];
                        gle.gameName = game[1];
                        gle.playerCount = game[2];
                        gle.totalChips = game[3];
                        rooms.Add(gle);
                        ListViewItem lvi = new ListViewItem(game);
                        listView1.Items.Add(lvi);
                    }
                }
            }
        }
コード例 #6
0
 public GameListEntryViewModel(GameListEntry entry)
 {
     Model = entry;
 }