Пример #1
0
 public EmployeeFactory()
 {
     contentHub      = ContentHub.Instance;
     teamManager     = TeamManager.Instance;
     missionManager  = MissionManager.Instance;
     gameTime        = GameTime.GameTime.Instance;
     employeeManager = EmployeeManager.Instance;
     names           = contentHub.GetNameLists();
     skills          = contentHub.GetSkillSet().keys;
     allPurpSkillDef = ContentHub.Instance.GeneralPurposeSkill;
     empMaterial     = contentHub.DefaultEmpMaterial;
     empUiMaterial   = contentHub.DefaultEmpUiMaterial;
     InitColorSwapTex();
     spriteColors            = new Color[colorSwapTex.width];
     specialEmployeesToSpawn = new List <EmployeeDefinition>();
     EmployeeSpecials.AddRange(ModHolder.Instance.GetCustomSpecials());
 }
Пример #2
0
 public ActionResult Test(int?id, string message)
 {
     if (ModelState.IsValid)
     {
         if (id != null)
         {
             var    context = GlobalHost.ConnectionManager.GetHubContext <ContentHub>();
             string connID  = ContentHub.GetClientConnection((int)id);
             if (connID != null)
             {
                 context.Clients.Client(connID).test1(message);
             }
             else
             {
                 TempData["message"] = "Brak podlaczonego klienta";
             }
         }
     }
     return(RedirectToAction("Test"));
 }
Пример #3
0
        private void Awake()
        {
            contentHub            = ContentHub.Instance;
            NotificationManager   = NotificationManager.Instance;
            EmployeeToGuiMap      = new Dictionary <EmployeeData, GameObject>();
            this.specialEmployees = contentHub.GetEmployeeLists();
            factoryObject         = new EmployeeFactory();

            if (GameSettings.NewGame)
            {
                InitDefaultState();
            }
            else
            {
                LoadState();
            }

            bank              = contentHub.bank;
            dayChangedAction += DayChanged;
            GameTimeDayTickEvent.AddListener(dayChangedAction);
        }
Пример #4
0
        private void NotifyCampaignUpdate(List <int> clientIds, int campaignId)
        {
            var context = GlobalHost.ConnectionManager.GetHubContext <ContentHub>();

            var schedule = clientScheduleService.GetCurrentSchedule(campaignId);

            if (schedule != null)
            {
                string message = clientScheduleService.GetScheduleAsString(schedule);

                foreach (int id in clientIds)
                {
                    string connID = ContentHub.GetClientConnection(id);
                    if (connID != null)
                    {
                        context.Clients.Client(connID).test1(message);
                        //return true;
                    }
                    //else
                    //    return false;
                }
            }
        }