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; } }
protected Duck() { _fly = new FlyClass(); _quack = new QuackClass(); _walk = new WalkClass(); _swim = new SwimClass(); }
public TurkeyCock(IFly f, ICluck c, IWalk w, ISwim s) { _fly = f; _cluck = c; _walk = w; _swim = s; }
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 }
public Duck(IFly f, IQuack q, IWalk w, ISwim s) { _fly = f; _quack = q; _walk = w; _swim = s; }
protected BaseDuck(IFly fly, IQuack quack, ISwim swim, IWalk walk, IName name) { _fly = fly; _quack = quack; _swim = swim; _walk = walk; _name = name; }
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(); }
private void Awake() { if (walkComp == null) { walkComp = GetComponent <IWalk>(); } if (attackComp == null) { attackComp = GetComponent <IAttack>(); } }
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; } }
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; }
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; }
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(); } } }
public Duck(IFly _fly, IQuack _quack, IWalk _walk) : base(_fly, _quack, _walk) { }
public Behavior(IBark bark, IWalk walk) { this.bark = bark; this.walk = walk; }
static void GoForAWalk(IWalk WalkingAnimal) { WalkingAnimal.Walking(); }
protected BaseDuck(IFly fly, IQuack quack, IWalk walk) { _fly = fly; _quack = quack; _walk = walk; }
public Duck(IFly flyBehaviour, ISwim swimBehaviour, IWalk walkBehaviour) { _flyBehaviour = flyBehaviour; _swimBehaviour = swimBehaviour; _walkBehaviour = walkBehaviour; }
// public void Show(MyDog a) // { // a.Walk(); // } // // public void Show(MyCat b) // { // b.Walk(); // } public void Show(IWalk w) { w.Walk(); }
virtual public void WatchW(IWalk an) { Console.Write($"{this.GetType().Name} is watching how "); an.Walk(); }