package; /** * Model is changing the Views unidirectional * controlled by view.control object * @author Sylvio Sell, Rostock Germany 2017 */ class Model implements ModelInterface { public function new() { view = new Array(); } // Interface --------------------------------------- public var view:Array; public function addView(view:ViewInterface) { trace("Model.addView()"); this.view.push(view); view.addModel(this); view.msgFromModel("Hello from MODEL"); } public function delView(view:ViewInterface) { trace("Model.delView()"); this.view.remove(view); } // funktions that can be called by view public function msgFromView(view:ViewInterface, msg:String):Void { trace("Message from View" + msg); } /* public function setPosition(x:Int, y:Int) { } public function setSize(w:Int, h:Int) { } public function setZoom(z:Int) { } */ }