Пример #1
0
 public MoveBehaviour CreateMoveBehaviour(Unit unit)
 {
     switch (unit.GetType().ToString())
     {
         case "duckhunt.Model.DuckEasy":
             return new StraightMoveBehaviour(unit);
         case "duckhunt.Model.DuckMedium":
             return new StraightMoveBehaviour(unit);
         default:
             return null;
     }
 }
Пример #2
0
 public DrawBehaviour CreateDrawBehaviour(Unit unit)
 {
     switch (unit.GetType().ToString())
     {
         case "duckhunt.Model.DuckEasy":
             return new DrawBehaviour(Canvas, unit);
         case "duckhunt.Model.DuckMedium":
             return new DrawBehaviour(Canvas, unit);
         default:
             return null;
     }
 }
Пример #3
0
 public void Remove(Unit unit)
 {
     behaviours = behaviours.Where(b => b.Unit != unit).ToList();
 }
Пример #4
0
 public MoveBehaviour(Unit unit)
 {
 }
Пример #5
0
 public StraightMoveBehaviour(Unit unit)
 {
     Unit = unit;
 }
Пример #6
0
 public LineMoveBehaviour(Unit unit)
 {
     Unit = unit;
 }
Пример #7
0
 public DrawBehaviour(Form1 canvas, Unit unit)
 {
     Canvas = canvas;
     Unit = unit;
 }