Esempio n. 1
0
        private void SetupSoftwareColumnDefinition(GUIListView listView)
        {
            listView.AddColumn("Name", content =>
            {
                SoftwareProduct softwareProduct = content as SoftwareProduct;
                Debug.Assert(softwareProduct != null);
                return(softwareProduct.Name);
            }, (obj1, obj2) =>
            {
                SoftwareProduct softwareProduct1 = obj1 as SoftwareProduct;
                SoftwareProduct softwareProduct2 = obj2 as SoftwareProduct;
                Debug.Assert(softwareProduct1 != null && softwareProduct2 != null);
                return(string.CompareOrdinal(softwareProduct1.Name, softwareProduct2.Name));
            }, false);

            listView.AddColumn("Release", content =>
            {
                SoftwareProduct softwareProduct = content as SoftwareProduct;
                Debug.Assert(softwareProduct != null);
                return(softwareProduct.Release.ToCompactString());
            }, (obj1, obj2) =>
            {
                SoftwareProduct softwareProduct1 = obj1 as SoftwareProduct;
                SoftwareProduct softwareProduct2 = obj2 as SoftwareProduct;
                Debug.Assert(softwareProduct1 != null && softwareProduct2 != null);
                return(softwareProduct1.Release.CompareTo(softwareProduct2.Release));
            }, false);

            listView.AddActionColumn("Inspect", action =>
            {
                SoftwareProduct item = action as SoftwareProduct;

                _selectedProduct = item;
            }, false);
        }
Esempio n. 2
0
        private void SetupDevColumnDefinition(GUIListView listView)
        {
            NameColumn(listView);
            listView.AddFilterColumn("Status", GetDevStatus,
                                     (o, o1) => String.Compare(GetDevStatus(o), GetDevStatus(o1),
                                                               StringComparison.Ordinal), true,
                                     GUIListView.FilterType.Name, GetDevStatus);
            listView.AddFilterColumn("Phase", o =>
            {
                if (o is SoftwareAlpha)
                {
                    var sa = o as SoftwareAlpha;
                    if (sa.InBeta)
                    {
                        return("Beta");
                    }
                    if (sa.InDelay)
                    {
                        return("Delay");
                    }
                    return("Alpha");
                }

                return(o.GetType().ToString());
            }, (o, o1) =>
            {
                string phase1 = "";
                string phase2 = "";

                if (o is SoftwareAlpha)
                {
                    var sa = o as SoftwareAlpha;
                    if (sa.InBeta)
                    {
                        phase1 = "Beta";
                    }
                    if (sa.InDelay)
                    {
                        phase1 = "Delay";
                    }
                    phase1 = "Alpha";
                }

                if (o1 is SoftwareAlpha)
                {
                    var sa = o as SoftwareAlpha;
                    if (sa.InBeta)
                    {
                        phase2 = "Beta";
                    }
                    if (sa.InDelay)
                    {
                        phase2 = "Delay";
                    }
                    phase2 = "Alpha";
                }

                return(String.CompareOrdinal(phase1, phase2));
            }, true, GUIListView.FilterType.Name, o =>
            {
                if (o is SoftwareAlpha)
                {
                    var sa = o as SoftwareAlpha;
                    if (sa.InBeta)
                    {
                        return("Beta");
                    }
                    if (sa.InDelay)
                    {
                        return("Delay");
                    }
                    return("Alpha");
                }

                return(o.GetType().ToString());
            });
            listView.AddColumn("Followers", o =>
            {
                SoftwareWorkItem item = o as SoftwareWorkItem;
                Debug.Assert(item != null);
                return(Mathf.RoundToInt(item.Followers).ToString("N0"));
            }, (o, o1) =>
            {
                SoftwareWorkItem item  = o as SoftwareWorkItem;
                SoftwareWorkItem item1 = o1 as SoftwareWorkItem;
                Debug.Assert(item != null);
                Debug.Assert(item1 != null);
                return((int)(item.Followers - item1.Followers));
            }, true);
            listView.AddColumn("Code", o =>
            {
                if (o is SoftwareAlpha)
                {
                    SoftwareAlpha item = o as SoftwareAlpha;
                    return(string.Format("{0:0.##}/{1:0.##}", (item.CodeProgress * item.CodeDevTime),
                                         item.CodeDevTime));
                }

                return("n/a");
            }, (o, o1) =>
            {
                SoftwareAlpha item  = o as SoftwareAlpha;
                SoftwareAlpha item1 = o1 as SoftwareAlpha;
                float val1          = item != null ? item.CodeProgress : float.MaxValue;
                float val2          = item1 != null ? item1.CodeProgress : float.MaxValue;
                return((int)(val1 - val2));
            }, true);
            listView.AddColumn("Art", o =>
            {
                if (o is SoftwareAlpha)
                {
                    SoftwareAlpha item = o as SoftwareAlpha;
                    return(string.Format("{0:0.##}/{1:0.##}", (item.ArtProgress * item.ArtDevTime),
                                         item.ArtDevTime));
                }

                return("n/a");
            }, (o, o1) =>
            {
                SoftwareAlpha item  = o as SoftwareAlpha;
                SoftwareAlpha item1 = o1 as SoftwareAlpha;
                float val1          = item != null ? item.ArtProgress : float.MaxValue;
                float val2          = item1 != null ? item1.ArtProgress : float.MaxValue;
                return((int)(val1 - val2));
            }, true);
            listView.AddColumn("StillBugs", o =>
            {
                if (o is SoftwareAlpha)
                {
                    SoftwareAlpha item = o as SoftwareAlpha;
                    if (item.InBeta)
                    {
                        return((int)item.FixedBugs);
                    }
                }

                return("n/a");
            }, (o, o1) =>
            {
                SoftwareAlpha item  = o as SoftwareAlpha;
                SoftwareAlpha item1 = o1 as SoftwareAlpha;
                float val1          = item != null && item.InBeta ? item.FixedBugs : float.MaxValue;
                float val2          = item1 != null && item.InBeta ? item1.FixedBugs : float.MaxValue;
                return((int)(val1 - val2));
            }, true);
            listView.AddActionColumn("Market", o =>
            {
                SoftwareWorkItem item = o as SoftwareWorkItem;
                Debug.Assert(item != null);
                HandleMarketing(item);
            }, false);
            listView.AddActionColumn("Promote", o =>
            {
                SoftwareWorkItem item = o as SoftwareWorkItem;
                Debug.Assert(item != null);
                PromoteSoftware(item);
            }, false);
        }
Esempio n. 3
0
 private void SetupSupportColumnDefinition(GUIListView supportList)
 {
     NameColumn(supportList);
     supportList.AddColumn("Active users", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         return(Mathf.RoundToInt(item.TargetProduct.Userbase).ToString("N0"));
     }, (o, o1) =>
     {
         SupportWork item  = o as SupportWork;
         SupportWork item1 = o1 as SupportWork;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return(item.TargetProduct.Userbase - item1.TargetProduct.Userbase);
     }, true);
     supportList.AddColumn("BugsFixed", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         return(Mathf.RoundToInt(item.StartBugs - item.TargetProduct.Bugs).ToString("N0"));
     }, (o, o1) =>
     {
         SupportWork item  = o as SupportWork;
         SupportWork item1 = o1 as SupportWork;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((item.StartBugs - item.TargetProduct.Bugs) -
                (item1.StartBugs - item1.TargetProduct.Bugs));
     }, true);
     supportList.AddColumn("BugsVerified", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         return(Mathf.RoundToInt(item.Verified).ToString("N0"));
     }, (o, o1) =>
     {
         SupportWork item  = o as SupportWork;
         SupportWork item1 = o1 as SupportWork;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((item.Verified) - (item1.Verified));
     }, true);
     supportList.AddColumn("TicketsQueued", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         return(Mathf.RoundToInt(item.Tickets.Count).ToString("N0"));
     }, (o, o1) =>
     {
         SupportWork item  = o as SupportWork;
         SupportWork item1 = o1 as SupportWork;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((item.Tickets.Count) - (item1.Tickets.Count));
     }, true);
     supportList.AddColumn("TicketsMissed", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         return(Mathf.RoundToInt(item.Missed).ToString("N0"));
     }, (o, o1) =>
     {
         SupportWork item  = o as SupportWork;
         SupportWork item1 = o1 as SupportWork;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((item.Missed) - (item1.Missed));
     }, true);
     supportList.AddActionColumn("Assign", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         item.guiItem.Assign("Support", null);
     }, false);
     supportList.AddActionColumn("Cancel", o =>
     {
         SupportWork item = o as SupportWork;
         Debug.Assert(item != null);
         item.CancelSupport();
     }, false);
 }
Esempio n. 4
0
 private void SetupMarketColumnDefinition(GUIListView marketList)
 {
     NameColumn(marketList);
     marketList.AddColumn("Type", o =>
     {
         MarketingPlan item = o as MarketingPlan;
         Debug.Assert(item != null);
         return(item.Type);
     }, null, false);
     marketList.AddColumn("Progress", o =>
     {
         MarketingPlan item = o as MarketingPlan;
         Debug.Assert(item != null);
         return(string.Format("{0:00}%", item.GetProgress() * 100f));
     }, (o, o1) =>
     {
         MarketingPlan item  = o as MarketingPlan;
         MarketingPlan item1 = o1 as MarketingPlan;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((int)(item.GetProgress() - item1.GetProgress()));
     }, true);
     marketList.AddColumn("Budget", o =>
     {
         MarketingPlan item = o as MarketingPlan;
         Debug.Assert(item != null);
         return(item.MaxBudget.Currency(false));
     }, (o, o1) =>
     {
         MarketingPlan item  = o as MarketingPlan;
         MarketingPlan item1 = o1 as MarketingPlan;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((int)(item.MaxBudget - item1.MaxBudget));
     }, true);
     marketList.AddColumn("Cost", o =>
     {
         MarketingPlan item = o as MarketingPlan;
         Debug.Assert(item != null);
         return(item.Spent.Currency(true));
     }, (o, o1) =>
     {
         MarketingPlan item  = o as MarketingPlan;
         MarketingPlan item1 = o1 as MarketingPlan;
         Debug.Assert(item != null);
         Debug.Assert(item1 != null);
         return((int)(item.Spent - item1.Spent));
     }, true);
     marketList.AddActionColumn("Takeover", o =>
     {
         MarketingPlan item = o as MarketingPlan;
         Debug.Assert(item != null);
         item.AutoDev     = false;
         item.Hidden      = false;
         var autoDevTasks = GameSettings.Instance.MyCompany.WorkItems.Where(wi => wi is AutoDevWorkItem);
         foreach (var workItem in autoDevTasks)
         {
             var autoDev = (AutoDevWorkItem)workItem;
             autoDev.MarketingItems.Remove(item);
         }
     }, false);
 }