コード例 #1
0
ファイル: MouthSimulator.cs プロジェクト: Jasonkatz/Dent
 public MouthSimulator(Mouth mouth, MouthUpdater mouthUpdater)
 {
     this.mouth = mouth;
     timeline = new Timeline();
     timeline.IntervalTick += timeline_intervalTick;
     this.mouthUpdater = mouthUpdater;
 }
コード例 #2
0
ファイル: MouthUpdate.cs プロジェクト: Jasonkatz/Dent
 // TODO: Formulate general entity updating convention
 // TODO: Add ability to update individual teeth
 public void Update(ref Mouth mouth)
 {
     foreach(UpdateProperty prop in Properties) {
         if(prop.AllTeeth == true) {
             log.InfoFormat("Updating parameter {0} of all teeth to {1}", prop.Name, prop.NewValue);
             mouth.Teeth.ForEach(t => {
                 ToothParameter param = t.Parameters.Single(p => p.Name == prop.Name);
                 if(param == null) {
                     log.ErrorFormat("Property with name {0} does not exist");
                 }
                 t.Parameters.Single(p => p.Name == prop.Name).Value = prop.NewValue;
             });
         } else {
             // TODO: Handle cases where not all teeth are updated
         }
     }
 }
コード例 #3
0
ファイル: MouthUpdater.cs プロジェクト: Jasonkatz/Dent
 public void Update(ref Mouth mouth, uint timeStep)
 {
     map[timeStep].Update(ref mouth);
 }