예제 #1
0
        internal MoveBehaviour CreateMoveBehaviour(Unit unit, string behaviour)
        {
            if (moveBehaviourMap.ContainsKey(behaviour))
            {
                return moveBehaviourMap[behaviour].CreateInstance(unit);
            }

            throw new Exception("Behaviour with the name " + behaviour + " Not Found");
        }
 public MoveBehaviour CreateInstance(Unit unit)
 {
     return new FallingMoveBehaviour(unit);
 }
 public FallingMoveBehaviour(Unit unit)
 {
     this.unit = unit;
 }
 public DrawBehaviour CreateInstance(Unit unit)
 {
     return new FlyingDrawBehaviour(unit);
 }
 public FlyingDrawBehaviour(Unit unit)
 {
     this.unit = unit;
 }
예제 #6
0
 public void addUnitToMap(String name, Unit unit)
 {
     unitMap.Add(name, unit);
 }