var Controls = function (controllable_object) { this.ref = controllable_object; }; Controls.prototype.next = function () { this.ref.foo(); } // .. var Carousel = function () { this.controls = new Controls(this); }; // ..
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); menu = new Controls(this); menu.getSomeView().setOnClickListener(this); setContentView(menu); }
JPanel p=new JPanel(new FlowLayout()); p.add(new Controls()); content.add(p);
public static Controls getInstance(Object o) { if (o instanceof Controls) { return (Controls)o; } if (o != null) { return new Controls(ASN1Sequence.getInstance(o)); } return null; }
public static Controls getInstance(Object o) { if (o instanceof Controls) { return (Controls)o; } if (o != null) { return new Controls(ASN1Sequence.getInstance(o)); } return null; }
function Controls(what) { //what do we need to control this.controlWhat=what; } Controls.prototype.moveLeft = function() { console.log(this.controlWhat.speed, this.controlWhat.walkDistant); return this.controlWhat.speed * this.controlWhat.walkDistant; }; function Player() { this.speed = 1; this.walkDistant = 5; this.controls=new Controls(this); } var firstPlayer = new Player(); console.log(firstPlayer.controls.moveLeft());
var scene = new Scene(); var controls = new Controls(); scene.AddToUpdate(controls.update); scene.Animate();