コード例 #1
0
 /**
  * Construct a model with the given PaintTool as start PaintTool
  **/
 internal Model(PaintTool initPaintTool, ColorTool initColorTool)
 {
     setUpFactories(initColorTool);
     currentFactory = Factories[initPaintTool.type];
     currentFactory.ChangePaintTool(initPaintTool, initColorTool);
     currentColorTool = initColorTool;
 }
コード例 #2
0
 internal void ChangePaintTool(PaintTool newPaintTool)
 {
     ClearRenderQueue();
     Factories[newPaintTool.type].ChangePaintTool(newPaintTool, currentColorTool);
     currentFactory = Factories[newPaintTool.type];
 }
コード例 #3
0
 //TODO see if logic for this could be done clearer
 internal abstract void ChangePaintTool(PaintTool newTool, ColorTool presentColorTool);
コード例 #4
0
 /**
  * Apply the new tool to the Factory
  */
 internal override void ChangePaintTool(PaintTool newTreeTool, ColorTool presentColorTool)
 {
     TreeTool newTool = (TreeTool)newTreeTool; // TODO Is there any way TODO this without casting?
     treeAdded = false;
     this.presentTreeTool = newTool;
     this.presentColorTool = presentColorTool;
     this.growthSpeed = presentTreeTool.growthSpeed;
     growthCount = 0;
 }