コード例 #1
0
ファイル: RoomPage.xaml.cs プロジェクト: DeEsthete/BrpgCenter
        public RoomPage(MainPocket pocket, ChatClient chatClient, Room room, bool isHost, Character character)
        {
            InitializeComponent();
            this.pocket           = pocket;
            this.room             = room;
            this.isHost           = isHost;
            this.chatClient       = chatClient;
            this.stateClient      = new StateClient(room.Ip, room.Port, pocket.Player, character);
            this.charactersClient = new CharactersClient(room.Ip, room.Port, pocket.Player, character);
            this.storageClient    = new StorageClient(room.Ip, room.Port, pocket.Player, character);
            paint             = new Paint();
            pocket.ServerIsOn = true;

            AcceptServerFirstMessage();

            chatClient.ReceiveMessage();
            AddMessageToListBox();

            stateClient.StartReceive();
            ApplyPlayersInRoom();

            charactersClient.StartReceive();
            ApplyCharactersInRoom();

            storageClient.StartReceive();
            ApplyFilesInStorage();

            colorPicker.SelectedColor = paint.Color;

            if (room.GameMaster != null)
            {
                masterPlayerName.Text = room.GameMaster.NickName;
            }
        }
コード例 #2
0
 public CharacterPage(MainPocket pocket)
 {
     InitializeComponent();
     this.pocket = pocket;
     character   = new Character();
     pocket.Context.Characters.Add(character);
 }
コード例 #3
0
        public MainWindow()
        {
            InitializeComponent();
            Closed += MainWindowClosed;
            pocket  = new MainPocket
            {
                MainWindow = this,
                Context    = new BrpgCenterContext()
            };

            pocket.LanguageManager.LanguageNames = LanguageManager.ReadFileLanguageList();
            //pocket.LanguageManager.AddNewLanguage();

            pocket.Rooms      = pocket.Context.Rooms.Local;
            pocket.Characters = pocket.Context.Characters.Local;
            pocket.Player.CountCharactaers = pocket.Context.Characters.Count();
            pocket.Player.CountRooms       = pocket.Context.Rooms.Count();
            //pocket.Context.Characters.Add(new Character());

            Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\PlayerData\");
            pocket.Player = ReadPlayerFile();
            if (pocket.Player == null)
            {
                pocket.Player = new Player();
            }

            if (pocket.Player.NickName == null)
            {
                Content = new ProfileEditPage(pocket);
            }
            else
            {
                Content = new MainMenuPage(pocket);
            }
        }
コード例 #4
0
 public CharactersPage(MainPocket pocket)
 {
     InitializeComponent();
     this.pocket = pocket;
     pocket.Context.SaveChanges();
     foreach (var i in pocket.Context.Characters)
     {
         charactersListBox.Items.Add("Id: " + i.Id + " Имя: " + i.FullName);
     }
 }
コード例 #5
0
        public RoomsPage(MainPocket pocket)
        {
            InitializeComponent();
            this.pocket = pocket;

            //добавление комнат
            foreach (var i in pocket.Context.Rooms)
            {
                roomsListBox.Items.Add("Id: " + i.Id + "Ip: " + i.Ip + "Port: " + i.Port);
            }
        }
コード例 #6
0
        public CharacterPageThird(MainPocket pocket, Character character)
        {
            InitializeComponent();
            this.pocket    = pocket;
            this.character = character;

            raceTextBox.Text     = character.Race;
            birthdayTextBox.Text = character.Birthday;
            advaDisTextBox.Text  = character.AdvantagesDisadvantages;
            skillsTextBox.Text   = character.Skills;
            equipTextBox.Text    = character.Equip;
        }
コード例 #7
0
        public SettingsPage(MainPocket pocket)
        {
            InitializeComponent();
            this.pocket = pocket;

            pocket.LanguageManager = new LanguageManager();
            pocket.LanguageManager.LanguageNames = LanguageManager.ReadFileLanguageList();

            languagesComboBox.Items.Add("Russian");
            for (int i = 0; i < pocket.LanguageManager.LanguageNames.Count; i++)
            {
                languagesComboBox.Items.Add(pocket.LanguageManager.LanguageNames[i]);
            }
        }
コード例 #8
0
        public CharacterPage(MainPocket pocket, Character character)
        {
            InitializeComponent();
            this.pocket    = pocket;
            this.character = character;

            fullNameTextBox.Text = character.FullName;
            raceTextBox.Text     = character.Race;
            statusTextBox.Text   = character.Status;
            leatherTextBox.Text  = character.SkinColor;
            worldTextBox.Text    = character.WorldName;
            ageTextBox.Text      = character.Age.ToString();
            mainNoteTextBox.Text = character.MainNote;
        }
コード例 #9
0
        public CharacterPageOne(MainPocket pocket, Character character)
        {
            InitializeComponent();
            this.pocket    = pocket;
            this.character = character;

            eyeDescriptionTextBox.Text = character.Eyes;
            hairTextBox.Text           = character.Hair;
            mainHandTextBox.Text       = character.MainHand;
            religionTextBox.Text       = character.Religion;
            genderTextBox.Text         = character.Gender;
            growthTextBox.Text         = character.Growth.ToString();
            weightTextBox.Text         = character.Weight.ToString();
            smTextBox.Text             = character.SM.ToString();
            tlTextBox.Text             = character.TL.ToString();
        }
コード例 #10
0
        public MainMenuPage(MainPocket pocket)
        {
            InitializeComponent();
            this.pocket = pocket;
            if (pocket.LanguageManager != null && pocket.LanguageManager.CurrentLanguage != null && pocket.LanguageManager.CurrentLanguage != "Russian")
            {
                pocket.LanguageManager.Languages[pocket.LanguageManager.CurrentLanguage].Apllying(this);
            }

            if (pocket.Player.PathToImage != "none" && pocket.Player.PathToImage != null)
            {
                avatarImage.Source = new BitmapImage(new Uri(pocket.Player.PathToImage, UriKind.RelativeOrAbsolute));
            }
            nickNameTextBlock.Text        = pocket.Player.NickName;
            countRoomsTextBlock.Text      = pocket.Player.CountRooms.ToString();
            countCharactersTextBlock.Text = pocket.Player.CountCharactaers.ToString();
        }
コード例 #11
0
        public LiteraturePage(MainPocket pocket)
        {
            InitializeComponent();
            this.pocket = pocket;
            links       = new Dictionary <string, string>
            {
                { "Gurps RU", "https://vk.com/doc337304320_438358894?hash=75cce73307c1a99b66&dl=5c25cdb37d00a7d0b1" },
                { "Руководство Ксанатара обо Всём", "https://dungeonsanddragons.ru/xanathars-gude-to-everything-%D1%80%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE-%D0%BA%D1%81%D0%B0%D0%BD%D0%B0%D1%82%D0%B0%D1%80%D0%B0-%D0%BE%D0%B1%D0%BE-%D0%B2%D1%81%D1%91%D0%BC/" },
                { "Гайд по фракциям Фаэруна", "https://dungeonsanddragons.ru/adventurers-league-factions-guide/" },
                { "Стихийное зло — Путеводитель игрока", "https://dungeonsanddragons.ru/elemental-evil-players-companion/" }
            };

            foreach (var i in links)
            {
                literatureListBox.Items.Add(i.Key);
            }
        }
コード例 #12
0
        public CharacterPageTwo(MainPocket pocket, Character character)
        {
            InitializeComponent();
            this.pocket    = pocket;
            this.character = character;

            mvTextBox.Text      = character.Move.ToString();
            spTextBox.Text      = character.Speed.ToString();
            wlTextBox.Text      = character.Will.ToString();
            prTextBox.Text      = character.Per.ToString();
            fpTextBox.Text      = character.FP.ToString();
            stTextBox.Text      = character.ST.ToString();
            dxTextBox.Text      = character.DX.ToString();
            iqTextBox.Text      = character.IQ.ToString();
            htTextBox.Text      = character.HT.ToString();
            hpTextBox.Text      = character.HP.ToString();
            woundsTextBox.Text  = character.Wounds;
            fatigueTextBox.Text = character.Fatigue;
        }
コード例 #13
0
        public ProfileEditPage(MainPocket pocket)
        {
            InitializeComponent();
            this.pocket = pocket;
            this.player = pocket.Player;
            if (player.NickName == null)
            {
                player = new Player
                {
                    CountCharactaers = 0,
                    CountRooms       = 0,
                    NickName         = "Nickname",
                    PathToImage      = "none"
                };
            }

            if (player.PathToImage != "none" && player.PathToImage != null)
            {
                avatarImage.Source = new BitmapImage(new Uri(pocket.Player.PathToImage, UriKind.RelativeOrAbsolute));
            }
            nickNameTextBox.Text = player.NickName;
        }
コード例 #14
0
 public CreateRoomPage(MainPocket pocket)
 {
     InitializeComponent();
     this.pocket = pocket;
 }