Example #1
0
        public static EnhancementSession Start(Item item)
        {
            var s = new EnhancementSession();
            var r = new HistoryRecord()
            {
                Item           = item,
                PositionsAfter = new List <Range>()
                {
                    new Range()
                    {
                        from = chances[item.Type][item.enhLevel + 1] * 2,
                        to   = chances[item.Type][item.enhLevel + 1] + 1
                    }
                },
                PositionsBefore = new List <Range>()
                {
                    new Range()
                    {
                        from = 0, to = 1
                    }
                }
            };

            s.History.Add(r);
            return(s);
        }
Example #2
0
        private void FailButtonClick(Object obj, EventArgs args)
        {
            var item = new Item();

            item.Type     = ToItemType(FindViewById <Button>(Resource.Id.ItemType).Text);
            item.enhLevel = uint.Parse(FindViewById <Button>(Resource.Id.ItemLevel).Text);
            Log(string.Format("Failing Enhancement for item {0} of level {1}", item.Type, item.enhLevel));
            if (CurrentSession == null)
            {
                CurrentSession = EnhancementSession.Start(item);
            }
            else
            {
                CurrentSession.FailEnhance(item);
            }
            FillHistory();
            var cg = FindViewById <LinearLayout>(Resource.Id.chanceGraph);

            cg.RemoveAllViews();
            cg.AddView(new ChanceGraph(ApplicationContext, CurrentSession.CurrentPositions, _logBuffer));
            FindViewById <Button>(Resource.Id.FailEnhancement).Enabled = CurrentSession.CheckFailAvailableFor(item);
        }
Example #3
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     CurrentSession = null;
     ShowMain(this, null);
     return(base.OnOptionsItemSelected(item));
 }