summaryrefslogtreecommitdiff
path: root/bPod/com/oop/SelectionSystem.as
diff options
context:
space:
mode:
authorJules Laplace <carbon@melanarchy.org>2013-08-02 17:14:26 -0500
committerJules Laplace <carbon@melanarchy.org>2013-08-02 17:14:26 -0500
commit79670053c7247d3a49b607960efd284e93f057e5 (patch)
tree9617f6eefa38b2686ae409bf75cc27a340444eda /bPod/com/oop/SelectionSystem.as
parentc53827d5d044ae5ca7ebb27acb404b7a8988918e (diff)
install.pl
Diffstat (limited to 'bPod/com/oop/SelectionSystem.as')
-rw-r--r--bPod/com/oop/SelectionSystem.as89
1 files changed, 89 insertions, 0 deletions
diff --git a/bPod/com/oop/SelectionSystem.as b/bPod/com/oop/SelectionSystem.as
new file mode 100644
index 0000000..2c89bf0
--- /dev/null
+++ b/bPod/com/oop/SelectionSystem.as
@@ -0,0 +1,89 @@
+/*
+ Manages a set of UI Buttons and controls selection state
+*/
+
+class com.oop.SelectionSystem extends MovieClip
+{
+
+//----------------------------------------------------------------------------------
+
+
+
+ // Data array passed in at instantiation
+ private var systemData:Array;
+
+ // Linkage name of button clip
+ private var exportName:String;
+
+ // Store our current state as a number
+ private var currentSelection:Number;
+
+ // Store references to our items
+ private var listItems:Array;
+
+
+
+
+
+//----------------------------------------------------------------------------------
+
+ public function SelectionSystem()
+ {
+
+ }
+
+//----------------------------------------------------------------------------------
+
+ public function doInit(_systemData:Array, _exportName:String):Void
+ {
+ systemData = _systemData;
+ exportName = _exportName;
+ listItems = new Array();
+ attachButtonItems();
+
+ }
+
+
+
+ public function setSelection(_id:Number):Void
+ {
+ if(currentSelection!=_id)
+ {
+ listItems[currentSelection].setUnselected();
+ currentSelection = _id;
+ listItems[currentSelection].setSelected();
+ doAction();
+ }
+ }
+
+ private function attachButtonItems():Void {
+ //override
+ }
+
+
+ private function doAction():Void
+ {
+ //override
+ }
+
+
+ // Getter/setters
+
+ public function getSystemData():Array
+ {
+ return systemData;
+ }
+
+ public function getCurrentSelection():Number
+ {
+ return currentSelection;
+ }
+
+ public function setCurrentSelection(_val:Number):Void
+ {
+ currentSelection = _val;
+ }
+
+
+
+} \ No newline at end of file