Ejemplo n.º 1
0
    public void SetupDevice(DeviceTypeList Type)
    {
        switch (Type)
        {
        case DeviceTypeList.KAT_WALK:
            walkController            = new KATDevice_Walk();
            KATVR_Global.KDevice_Walk = walkController;
            switch (landform)
            {
            case LandformList.Enable:
                landformController             = new KATDevice_Landform2(targetMoveObject.gameObject, targetRotateObject);
                KATVR_Global.KDevice_Landform2 = landformController;
                landformArrow?.SetParent(null);
                landformArrow.localScale = Vector3.one;
                break;

            case LandformList.Disable:
                landformArrow?.gameObject.SetActive(false);
                break;

            default:
                break;
            }
            break;

        case DeviceTypeList.ComingSoon:
            break;

        default:
            break;
        }
    }
Ejemplo n.º 2
0
 protected Duck()
 {
     _fly   = new FlyClass();
     _quack = new QuackClass();
     _walk  = new WalkClass();
     _swim  = new SwimClass();
 }
Ejemplo n.º 3
0
 public TurkeyCock(IFly f, ICluck c, IWalk w, ISwim s)
 {
     _fly   = f;
     _cluck = c;
     _walk  = w;
     _swim  = s;
 }
Ejemplo n.º 4
0
        private void NeuerMaler_Click(object sender, RoutedEventArgs e)
        {
            IPaint paint = null;
            IWalk  walk  = null;

            // Momentan noch statische Werte
            // Evtl. die Maleigenschaften, die hier gebraucht werden als Variablen von dieser WindowKlasse setzen
            if (Malarten.SelectedIndex == 0)
            {
                paint = new PaintImage(new Image());
            }
            else if (Malarten.SelectedIndex == 1)
            {
                paint = new PaintSpray(Colors.Black, new Size(2, 2));
            }
            if (BewArten.SelectedIndex == 0)
            {
                walk = new WalkDirectional(7, 3);
            }
            else if (BewArten.SelectedIndex == 1)
            {
                walk = new WalkRectangular(10, 7, 20, 8, 2, DirType.Up);
            }

            Painter newPainter = new Painter(paint, walk);

            newPainter.setStartPos(new Point(0, 0));
            if ((paint != null) && (walk != null))
            {
                DrawingCanvas.AddPainter(newPainter);
            }

            //Maler
        }
Ejemplo n.º 5
0
 public Duck(IFly f, IQuack q, IWalk w, ISwim s)
 {
     _fly   = f;
     _quack = q;
     _walk  = w;
     _swim  = s;
 }
Ejemplo n.º 6
0
 protected BaseDuck(IFly fly, IQuack quack, ISwim swim, IWalk walk, IName name)
 {
     _fly   = fly;
     _quack = quack;
     _swim  = swim;
     _walk  = walk;
     _name  = name;
 }
Ejemplo n.º 7
0
 protected BaseTurkey(IFly fly, IGobble gobble, ISwim swim, IWalk walk, IName name)
 {
     _fly    = fly;
     _gobble = gobble;
     _swim   = swim;
     _walk   = walk;
     _name   = name;
 }
    static void Main(string[] args)
    {
        Person person = new Person();
        IWalk  walk   = person;
        ISpeak speak  = person;

        speak.sayHello();
        walk.walkForward();
    }
Ejemplo n.º 9
0
        private void Awake()
        {
            if (walkComp == null)
            {
                walkComp = GetComponent <IWalk>();
            }

            if (attackComp == null)
            {
                attackComp = GetComponent <IAttack>();
            }
        }
Ejemplo n.º 10
0
    void Act(GameObject animal)
    {
        switch (input)
        {
        case InputType.LMB:
        {
            ISpeak speak = animal.GetComponent <ISpeak>();
            if (speak != null)
            {
                speak.Speak();
                speakCount++;
            }
            break;
        }

        case InputType.RMB:
        {
            IWalk walk = animal.GetComponent <IWalk>();
            if (walk != null)
            {
                walk.Walk();
                walkCount++;
            }
            break;
        }

        case InputType.Space:
        {
            ISwim swim = animal.GetComponent <ISwim>();
            if (swim != null)
            {
                swim.Swim();
                swimCount++;
            }
            break;
        }

        case InputType.I:
        {
            IID id = animal.GetComponent <IID>();

            if (id != null)
            {
                id.Identify();
            }

            break;
        }

        default: break;
        }
    }
Ejemplo n.º 11
0
        public Painter(IPaint paint, IWalk walk)
        {
            InitializeComponent();
            this.Height = size.Height;
            this.Width = size.Width;

            WalkType = walk;
            PaintType = paint;
            VisualBrush WalkBrush = new VisualBrush(WalkType.GetFace(size));
            VisualBrush DrawBrush = new VisualBrush(PaintType.GetFace(size));

            walker.Fill = WalkBrush;
            drawer.Fill = DrawBrush;           
        }
Ejemplo n.º 12
0
        public Painter(IPaint paint, IWalk walk)
        {
            InitializeComponent();
            this.Height = size.Height;
            this.Width  = size.Width;

            WalkType  = walk;
            PaintType = paint;
            VisualBrush WalkBrush = new VisualBrush(WalkType.GetFace(size));
            VisualBrush DrawBrush = new VisualBrush(PaintType.GetFace(size));

            walker.Fill = WalkBrush;
            drawer.Fill = DrawBrush;
        }
Ejemplo n.º 13
0
 static void InterfaceTest()
 {
     Animal[] anims = new Animal[] { new Cat(), new Fish(), new Bird() };
     foreach (var item in anims)
     {
         //让会走路的走路
         IWalk iWalk = item as IWalk;
         if (iWalk != null)
         {
             item.Print();
             iWalk.Walk();
         }
     }
 }
Ejemplo n.º 14
0
 public Duck(IFly _fly, IQuack _quack, IWalk _walk) : base(_fly, _quack, _walk)
 {
 }
Ejemplo n.º 15
0
 public Behavior(IBark bark, IWalk walk)
 {
     this.bark = bark;
     this.walk = walk;
 }
Ejemplo n.º 16
0
 static void GoForAWalk(IWalk WalkingAnimal)
 {
     WalkingAnimal.Walking();
 }
Ejemplo n.º 17
0
 protected BaseDuck(IFly fly, IQuack quack, IWalk walk)
 {
     _fly   = fly;
     _quack = quack;
     _walk  = walk;
 }
Ejemplo n.º 18
0
 public Duck(IFly flyBehaviour, ISwim swimBehaviour, IWalk walkBehaviour)
 {
     _flyBehaviour  = flyBehaviour;
     _swimBehaviour = swimBehaviour;
     _walkBehaviour = walkBehaviour;
 }
Ejemplo n.º 19
0
        // public void Show(MyDog a)
        // {
        //     a.Walk();
        // }
        //
        // public void Show(MyCat b)
        // {
        //     b.Walk();
        // }

        public void Show(IWalk w)
        {
            w.Walk();
        }
Ejemplo n.º 20
0
 virtual public void WatchW(IWalk an)
 {
     Console.Write($"{this.GetType().Name} is watching how ");
     an.Walk();
 }