Permalink
Browse files

Removes some dead code. Applies formatting.

  • Loading branch information...
1 parent d37fc9f commit a872e8fd44e2fbe0dbfc04deaf0914865c7e8c42 @darscan darscan committed Oct 13, 2012
@@ -1,10 +1,21 @@
+//------------------------------------------------------------------------------
+// Copyright (c) 2012 the original author or authors. All Rights Reserved.
+//
+// NOTICE: You are permitted to use, modify, and distribute this file
+// in accordance with the terms of the license agreement accompanying it.
+//------------------------------------------------------------------------------
+
package robotlegs.bender.extensions.commandCenter.impl
{
import robotlegs.bender.extensions.commandCenter.api.ICommandMapping;
public class CommandMappingList
{
-
+
+ /*============================================================================*/
+ /* Public Properties */
+ /*============================================================================*/
+
protected var _head:ICommandMapping;
public function get head():ICommandMapping
@@ -19,34 +30,38 @@ package robotlegs.bender.extensions.commandCenter.impl
_head = value;
}
}
-
+
public function get tail():ICommandMapping
{
- if(!_head) return null;
-
+ if (!_head) return null;
+
var theTail:ICommandMapping = _head;
- while(theTail.next)
+ while (theTail.next)
{
theTail = theTail.next
}
return theTail;
}
-
+
+ /*============================================================================*/
+ /* Public Functions */
+ /*============================================================================*/
+
public function remove(item:ICommandMapping):void
{
var link:ICommandMapping = _head;
- if(link == item)
+ if (link == item)
{
_head = item.next;
}
- while(link)
+ while (link)
{
- if(link.next == item)
+ if (link.next == item)
{
link.next = item.next;
}
link = link.next;
}
}
}
-}
+}
@@ -11,8 +11,6 @@ package robotlegs.bender.extensions.eventCommandMap.impl
import org.swiftsuspenders.Injector;
import robotlegs.bender.extensions.commandCenter.api.ICommandMapping;
import robotlegs.bender.extensions.commandCenter.api.ICommandTrigger;
- import robotlegs.bender.framework.impl.guardsApprove;
- import robotlegs.bender.extensions.commandCenter.impl.CommandMapping;
import robotlegs.bender.extensions.commandCenter.impl.CommandMappingList;
public class EventCommandExecutor
@@ -24,8 +22,6 @@ package robotlegs.bender.extensions.eventCommandMap.impl
private var _trigger:ICommandTrigger;
- private var _mappings:Vector.<ICommandMapping>;
-
private var _mappingList:CommandMappingList;
private var _injector:Injector;
@@ -62,7 +62,6 @@ package robotlegs.bender.extensions.eventCommandMap.impl
return _commandCenter.unmap(getTrigger(type, eventClass));
}
-
/*============================================================================*/
/* Private Functions */
/*============================================================================*/
@@ -21,8 +21,6 @@ package robotlegs.bender.extensions.eventCommandMap.impl
/* Private Properties */
/*============================================================================*/
- private const _mappings:Vector.<ICommandMapping> = new Vector.<ICommandMapping>;
-
private const _mappingList:CommandMappingList = new CommandMappingList();
private var _dispatcher:IEventDispatcher;
@@ -53,7 +51,7 @@ package robotlegs.bender.extensions.eventCommandMap.impl
public function addMapping(mapping:ICommandMapping):void
{
verifyCommandClass(mapping);
- if(_mappingList.tail)
+ if (_mappingList.tail)
{
_mappingList.tail.next = mapping;
}
@@ -67,8 +65,8 @@ package robotlegs.bender.extensions.eventCommandMap.impl
public function removeMapping(mapping:ICommandMapping):void
{
_mappingList.remove(mapping);
-
- if(!_mappingList.head)
+
+ if (!_mappingList.head)
removeListener();
}
@@ -92,4 +90,4 @@ package robotlegs.bender.extensions.eventCommandMap.impl
_dispatcher.removeEventListener(_type, _executor.execute);
}
}
-}
+}

0 comments on commit a872e8f

Please sign in to comment.