private void AddProperty <T>(int propertyIndex, string name, T defaultValue) where T : IComparable <T> { if (properties.ContainsKey(propertyIndex)) { throw new ArgumentException($"Property index {propertyIndex} being reused"); } properties[propertyIndex] = new GameDataProperty <T>(propertyIndex, name, defaultValue); }
public Objective(int id, string name, List <Job> dJobs) { Id = id; Complete = new GameDataProperty <bool>(Id, "Complete", false); dependentJobs = dJobs; foreach (Job job in dJobs) { job.Complete.Subscribe(OnJobProgressUpdated); } }
private void OnJobProgressUpdated(GameDataProperty prop) { Complete.Value = dependentJobs.All(job => job.Complete); }