Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 private void OnJobProgressUpdated(GameDataProperty prop)
 {
     Complete.Value = dependentJobs.All(job => job.Complete);
 }