package Checkers.logics { import flash.events.EventDispatcher; /** * Referee.as * Abstract Class * This class is designed to determine the outcome of the checkers game * You shouldn't need to change anything here * @author Fan Di */ public class RefereeAbstract extends EventDispatcher { public var state:*; // Describes the Outcome, or the state of the board public var turn:String; private var view:IGameView; // View Game Port private var winner:String; //Template Methods final public function moveComplete(move:Object, view:IGameView):void { state = doMove(move); updateView(view, state); } //Abstract methods protected function doMove(move:Object):* { return state; } protected function showWinner():void { } public function hint():Object { return null; } public function validate(move:Object, force:Boolean = true):Boolean { return true; } public function changeTurn():void { } protected function updateView(view:IGameView, state:*):void { view.updateView(state); } public function reset():void { winner = null; } } }