Exemple #1
0
        public void PushDeal()
        {
            PropertyHelper.DealIsPushed = true;

            SoftwareProduct[] Products = Settings.simulation.GetAllProducts().Where(pr =>
                                                                                    (pr.Type.ToString() == "CMS" ||
                                                                                     pr.Type.ToString() == "Office Software" ||
                                                                                     pr.Type.ToString() == "Operating System" ||
                                                                                     pr.Type.ToString() == "Game") &&
                                                                                    pr.Userbase > 0 &&
                                                                                    pr.DevCompany.Name != Settings.MyCompany.Name &&
                                                                                    pr.ServerReq > 0 &&
                                                                                    !pr.ExternalHostingActive)
                                         .ToArray();

            int index = PropertyHelper.Random.Next(0, Products.Length);

            SoftwareProduct prod = Settings.simulation.GetProduct(Products.ElementAt(index).SoftwareID, false);

            ServerDeal deal = new ServerDeal(Products[index])
            {
                Request = true
            };

            deal.StillValid(true);
            HUD.Instance.dealWindow.InsertDeal(deal);
        }
Exemple #2
0
        public void PushDeal()
        {
            PropertyHelper.DealIsPushed = true;

            SoftwareProduct[] Products = GameSettings.Instance.simulation.GetAllProducts().Where(pr =>
                                                                                                 (pr.Type.ToString() == "CMS" ||
                                                                                                  pr.Type.ToString() == "Office Software" ||
                                                                                                  pr.Type.ToString() == "Operating System" ||
                                                                                                  pr.Type.ToString() == "Game") &&
                                                                                                 pr.Userbase > 0 &&
                                                                                                 pr.DevCompany.Name != GameSettings.Instance.MyCompany.Name &&
                                                                                                 pr.ServerReq > 0 &&
                                                                                                 !pr.ExternalHostingActive)
                                         .ToArray();

            int index = PropertyHelper.rnd.Next(0, Products.Length);

            SoftwareProduct prod =
                GameSettings.Instance.simulation.GetProduct(Products.ElementAt(index).SoftwareID, false);

            //var servers = GameSettings.Instance.GetAllServers();
            //foreach(var srv in servers)
            //{
            //    foreach(var item in srv.Items)
            //    {
            //        item.HandleLoad(100f);
            //    }
            //}
            ServerDeal deal = new ServerDeal(Products[index])
            {
                Request = true
            };

            deal.StillValid(true);
            HUD.Instance.dealWindow.InsertDeal(deal);
        }