public TaskItem(String id, DateTime startTime, DateTime endTime, ActionableItem task) { this.id = id; this.startTime = startTime; this.endTime = endTime; this.task = task; }
public bool QueueTask(String id, double time, ActionableItem task) { if (numberOfWorkers <= 0) { workersDisplayText.GetComponent <TextWarning>().Warning(); return(false); } DateTime endTime = DateTime.Now.AddSeconds(time); taskQueue.Add(new TaskItem(id, DateTime.Now, endTime, task)); numberOfWorkers--; task.StartExecution(); return(true); }
private static IEnumerable <ISearchItem> GetItemsFromMetadata() { return(NavigationManager.MetaData .Where(m => m.Searchable) .Select(m => { var onActivate = CreateOnActivateFunction(m); var searchItem = new ActionableItem(m.Title, m.Caption, onActivate, m.Category ?? "No category", m.Keywords) { Icon = m.IconName, IsDefault = true, }; return searchItem; })); }
public void removeHabitatAction(String actionName) { for (int i = habitatActions.Count - 1; i >= 0; i--) { ActionableItem action = habitatActions.ElementAt(i); if (action.actionName == actionName) { GameObject button = action.actionButton; if (button != null) { UnityEngine.Object.Destroy(button); } habitatActions.RemoveAt(i); } } }