public BasicWorkerItemTaskViewModel(BasicWorker recieveUpdatesFrom, IList <string> productionOptions) { recieveUpdatesFrom.PropertyChanged += (s, e) => { if (e.PropertyName == PropertyName(() => recieveUpdatesFrom.CurrentProduction)) { Detail = recieveUpdatesFrom.CurrentProduction; } if (e.PropertyName == PropertyName(() => recieveUpdatesFrom.ProductionCounter)) { Tokens = new string(Enumerable.Repeat <char>('o', recieveUpdatesFrom.ProductionCounter).ToArray()); } }; var lookup = ObjectFactory.ProductionLookup(); productionOptions.Select(key => new List <ProductionOptionItem> { new ProductionOptionItem(key, lookup.GetLabelFor(key), recieveUpdatesFrom) }); ProductionOptions = new List <ProductionOptionItem> { new ProductionOptionItem("smallstorage", "Storage", recieveUpdatesFrom), new ProductionOptionItem("basicmine", "Mine", recieveUpdatesFrom), new ProductionOptionItem("basicquarry", "Quarry", recieveUpdatesFrom), new ProductionOptionItem(null, "None", recieveUpdatesFrom) }; }
public ProductionOptionItem(string key, string label, BasicWorker target) { Key = key; Label = label; Target = target; MeetsRequirements = true; Click = new CommandHandler <ProductionOptionItem>(vm => vm.Apply()); }
public void DeactivateWorker(BasicWorker worker, WaypointNode target) { worker.gameObject.SetActive(false); if (targets.IndexOf(target) != -1) { workersOnTarget[targets.IndexOf(target)]--; } waiting.Add(worker); workers.Remove(worker); }
private void SendWorker(BasicWorker worker, WaypointNode target) { worker.gameObject.SetActive(true); worker.SetTarget(target); workers.Add(worker); }