private void ListSubscribers_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (this.listSubscribers.SelectedItem is CharacterInfoModel selectItem)
            {
                this.btnSave.Visibility   = Visibility.Hidden;
                this.btnEdit.Visibility   = Visibility.Visible;
                this.btnDelete.Visibility = Visibility.Visible;
                this.btnCancel.Visibility = Visibility.Visible;

                this.txtNickname.Text           = selectItem.Nickname;
                this.numCombatPower.Value       = selectItem.CombatPower;
                this.comboJob.SelectedValue     = selectItem.JobType;
                this.checkOnlyDefence.IsChecked = selectItem.IsOnlyDefence;
                this.checkEliteExcept.IsChecked = selectItem.IsEliteExclusion;

                if (selectItem.PartyGroup > 0)
                {
                    this.checkPartyGroup.IsChecked = true;
                    this.numParityGroup.Visibility = Visibility.Visible;
                    this.numParityGroup.Value      = selectItem.PartyGroup;
                }
                else
                {
                    this.checkPartyGroup.IsChecked = false;
                    this.numParityGroup.Visibility = Visibility.Collapsed;
                    this.numParityGroup.Value      = null;
                }

                this._selectCharacterInfo = selectItem;
            }
        }
Beispiel #2
0
 /*
  * Contructor for Masterpage, initialize all components and BindingContext
  *
  * PARAM
  * page: encapsulate page
  * user: encapsulate user
  * items: encapsulate items
  * weapon: encapsulate weapon
  * truth: encapsulate truth
  * mainpage: encapsulate mainpage
  * ContentPage: encapsulate display
  *
  * RETURNS Nothing
  */
 public MasterPageViewModel(Page page, UserModel user, InventoryItemsModel items, WeaponInfoModel weapon, logged truth,
                            MasterPageView mainpage, ContentPage display, DungeonView dungeon, ItemInfoModel ItemInv, ShopModel Shop, CharacterInfoModel Characters)
 {
     this.page       = page;
     this.user       = user;
     this.items      = items;
     this.truth      = truth;
     this.weapon     = weapon;
     this.ItemInv    = ItemInv;
     this.Characters = Characters;
     this.mainpage   = mainpage;
     this.dungeon    = dungeon;
     this.Shop       = Shop;
     weapon.SetWeaponAsync(display, UserModel.CheckForstring(items.Localfile, "Equipped:"));
     Tasks_Clicked     = new Command(async() => await TaskNavAsync());
     Inventory_Clicked = new Command(async() => await InventoryNavAsync());
     Dungeon_Clicked   = new Command(async() => await DungeonNavAsync());
     About_Clicked     = new Command(async() => await AboutNavAsync());
     Settings_Clicked  = new Command(async() => await SettingsNavAsync());
     Stats_Clicked     = new Command(async() => await StatsNavAsync());
     Shop_Clicked      = new Command(async() => await ShopNavAsync());
     PageOn            = new PageOpenModel();
     PageOn.Tasks      = true;
     dungeon.Shop      = this.Shop;
 }
Beispiel #3
0
        public async Task <bool> PushCharacter(CharacterInfoModel characterInfo)
        {
            var json        = JsonConvert.SerializeObject(characterInfo);
            var httpContent = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

            var result = (await _httpClient.PostAsync("people/", httpContent)).StatusCode !=
                         System.Net.HttpStatusCode.OK ? false : true;

            Debug.WriteLine("Http client use for Post");
            return(result);
        }
Beispiel #4
0
        public async Task <bool> PushCharacter(CharacterInfoModel characterInfo)
        {
            var message = await Api.PushCharacter(characterInfo);

            Debug.WriteLine("Rest API use for Post");
            if (message.IsSuccessStatusCode)
            {
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        logged truth = new logged();// Used for telling threads of the application to stop running whenever this is false

        /*
         * Initialize all components and classes for traversing through both details page and masterpage
         * PARAM
         * user: the user data
         * items: the items data
         * RETURNS Nothing
         */
        public AddView(UserModel user, InventoryItemsModel items, StatsModel stats)
        {
            InitializeComponent();
            WeaponInfoModel    weapon      = new WeaponInfoModel(items);
            ItemInfoModel      Invitem     = new ItemInfoModel(items);
            CharacterInfoModel Characters  = new CharacterInfoModel(items, user.LocalLogin);
            ShopModel          Shop        = new ShopModel(items);
            DungeonModel       realDungeon = new DungeonModel();

            Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
            DungeonView dungeon = new DungeonView(user, items, weapon, Invitem, stats, false, realDungeon);

            this.Detail = new NavigationPage(new TasksView(user, items, truth, dungeon, new InventoryView(items, weapon, user, Invitem, Characters))); // Set Detailspage arguments with user information and truth value.
            this.Master = new MasterPageView(Detail, user, items, weapon, truth, dungeon, Invitem, Shop, Characters);                                  // set the masterpage information with user, items, and truth values.
        }
 private void BtnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (_selectCharacterInfo != null)
     {
         if (Validate(out string nickname) == true)
         {
             this._characterList.Remove(_selectCharacterInfo);
             var beforeCombat = _selectCharacterInfo.CombatPower;
             _selectCharacterInfo = CreateCharacterInfoModel(nickname);
             _selectCharacterInfo.BeforeCombatPower = beforeCombat;
             this._characterList.Add(_selectCharacterInfo);
             Clear();
             _taskQueue.Enqueue(FileSave);
         }
     }
 }
        private CharacterModel Character(string characterId, CharacterInfoModel characterInfo)
        {
            var characterPath = characterInfo.Response.Character.Data;

            CharacterModel character = new CharacterModel
            {
                Id       = long.Parse(characterId),
                Light    = characterPath.Light.ToString(),
                Class    = characterPath.ClassType == 0 ? "Titan" : characterPath.ClassType == 1 ? "Hunter" : "Warlock",
                Race     = characterPath.RaceType == 0 ? "Human" : characterPath.RaceType == 1 ? "Awoken" : "Exo",
                Emblem   = "https://www.bungie.net" + characterPath.EmblemPath,
                EmblemBG = "https://www.bungie.net" + characterPath.EmblemBackgroundPath
            };

            return(character);
        }
Beispiel #8
0
 public ShopViewModel(ShopModel items, ItemInfoModel Inv, WeaponInfoModel Weapon, CharacterInfoModel Characters, UserModel user, bool test = false)
 {
     Gold            = UserModel.CheckForstring(items.Inv.Localfile, "Gold:");
     Keys            = UserModel.CheckForstring(items.Inv.Localfile, "Keys:");
     Character       = user.Character;
     this.items      = items;
     this.Inv        = Inv;
     this.Weapon     = Weapon;
     this.Characters = Characters;
     if (!test)
     {
         Volumes = new ObservableCollection <ItemModel>();
         Task.Run(async() =>
         {
             await CreateLists(items, Volumes);
         });
     }
 }
        private void Clear()
        {
            txtNickname.Text              = "";
            numCombatPower.Value          = null;
            comboJob.SelectedIndex        = 0;
            _selectCharacterInfo          = _dummy;
            listSubscribers.SelectedIndex = -1;
            checkEliteExcept.IsChecked    = false;
            checkOnlyDefence.IsChecked    = false;

            this.btnSave.Visibility   = Visibility.Visible;
            this.btnEdit.Visibility   = Visibility.Hidden;
            this.btnCancel.Visibility = Visibility.Hidden;
            this.btnDelete.Visibility = Visibility.Hidden;

            this.checkPartyGroup.IsChecked = false;
            this.numParityGroup.Value      = null;
            this.numParityGroup.Visibility = Visibility.Collapsed;
        }
 /*
  * Constructor for Inventory
  * PARAM items to be used by the class
  * RETURNS Nothing
  */
 public InventoryView(InventoryItemsModel items, WeaponInfoModel weapon, UserModel user, ItemInfoModel ItemInv, CharacterInfoModel characters)
 {
     tutorial        = false;
     this.items      = items;
     this.weapon     = weapon;
     this.User       = user;
     this.ItemInv    = ItemInv;
     this.pots       = ItemInv.pots;
     this.weapons    = weapon.weapons;
     this.characters = characters.Characters;
     InitializeComponent();
     DisplayInventory();
     DisplayKey();
     DisplayGold();
     DisplayEquipped();
     DisplayNoWep();
     DisplayNoItem();
     Character.Text = User.Character;
 }
Beispiel #11
0
 public ShopView(ShopModel items, ItemInfoModel Inv, WeaponInfoModel Weapon, CharacterInfoModel Characters, UserModel user)
 {
     InitializeComponent();
     BindingContext = new ShopViewModel(items, Inv, Weapon, Characters, user);
 }
Beispiel #12
0
 private CharacterInfoModel FindFreeTopCombatPower(Position position, JobGroupType jobGroupType, CharacterInfoModel dealer = null)
 {
     for (int i = 0; i < this._sortNonePartyCharacterInfoModels.Count; ++i)
     {
         if (this._sortNonePartyCharacterInfoModels[i].JobGroupType == jobGroupType)
         {
             if (_includeBattleNickname.Contains(this._sortNonePartyCharacterInfoModels[i].Nickname))
             {
                 continue;
             }
             else if (position == Position.Elite && this._sortNonePartyCharacterInfoModels[i].IsEliteExclusion)
             {
                 continue;
             }
             else if ((position == Position.Attack || position == Position.Elite) && this._sortNonePartyCharacterInfoModels[i].IsOnlyDefence)
             {
                 continue;
             }
             if (dealer != null)
             {
                 if (dealer.JobType == this._sortNonePartyCharacterInfoModels[i].JobType)
                 {
                     continue;
                 }
             }
             _includeBattleNickname.Add(this._sortNonePartyCharacterInfoModels[i].Nickname);
             return(this._sortNonePartyCharacterInfoModels[i]);
         }
     }
     return(null);
 }
 /*
  * Contructor for Masterpage, initialize all components and BindingContext
  *
  * PARAM
  * page: encapsulate page
  * user: encapsulate user
  * items: encapsulate items
  * weapon: encapsulate weapon
  * truth: encapsulate truth
  *
  * RETURNS Nothing
  */
 public MasterPageView(Page page, UserModel user, InventoryItemsModel items, WeaponInfoModel weapon,
                       logged truth, DungeonView dungeon, ItemInfoModel itemInv, ShopModel Shop, CharacterInfoModel Characters)
 {
     InitializeComponent();
     BindingContext = new MasterPageViewModel(page, user, items, weapon, truth, this, this, dungeon, itemInv, Shop, Characters);
 }