Skip to content
Browse files

Tidy source code formatting

  • Loading branch information...
1 parent 30484a7 commit 441e3c319b733b190d9e319fc9dec884042237d1 @richardlord committed Oct 4, 2012
View
32 examples/robotlegs/asteroids/net/richardlord/asteroids/Main.as
@@ -1,20 +1,18 @@
-package net.richardlord.asteroids {
- import robotlegs.bender.bundles.mvcs.MVCSBundle;
- import flash.display.DisplayObjectContainer;
+package net.richardlord.asteroids
+{
import net.richardlord.ash.integration.robotlegs.AshExtension;
import net.richardlord.asteroids.events.StartGameEvent;
- import robotlegs.bender.extensions.commandCenter.CommandCenterExtension;
- import robotlegs.bender.extensions.eventCommandMap.EventCommandMapExtension;
+ import robotlegs.bender.bundles.mvcs.MVCSBundle;
import robotlegs.bender.extensions.eventCommandMap.api.IEventCommandMap;
- import robotlegs.bender.extensions.eventDispatcher.EventDispatcherExtension;
import robotlegs.bender.framework.api.IContext;
import robotlegs.bender.framework.impl.Context;
+ import flash.display.DisplayObjectContainer;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IEventDispatcher;
-
+
[SWF(width='600', height='450', frameRate='60', backgroundColor='#000000')]
public class Main extends Sprite
@@ -23,21 +21,21 @@ package net.richardlord.asteroids {
{
addEventListener( Event.ENTER_FRAME, init );
}
-
+
private function init( event : Event ) : void
{
removeEventListener( Event.ENTER_FRAME, init );
var context : IContext = ( new Context() )
.extend( AshExtension )
- .extend( MVCSBundle)
- .configure(this);
-
- context.injector.map(DisplayObjectContainer)
- context.injector.getInstance(IEventCommandMap);
- var commandMap : IEventCommandMap = context.injector.getInstance(IEventCommandMap);
- commandMap.map(StartGameEvent.START_GAME, StartGameEvent).toCommand(StartAsteroids);
- var dispatcher : IEventDispatcher = context.injector.getInstance(IEventDispatcher);
- dispatcher.dispatchEvent(new StartGameEvent(this, stage.stageWidth, stage.stageHeight));
+ .extend( MVCSBundle )
+ .configure( this );
+
+ context.injector.map( DisplayObjectContainer );
+ context.injector.getInstance( IEventCommandMap );
+ var commandMap : IEventCommandMap = context.injector.getInstance( IEventCommandMap );
+ commandMap.map( StartGameEvent.START_GAME, StartGameEvent ).toCommand( StartAsteroids );
+ var dispatcher : IEventDispatcher = context.injector.getInstance( IEventDispatcher );
+ dispatcher.dispatchEvent( new StartGameEvent( this, stage.stageWidth, stage.stageHeight ) );
}
}
}
View
15 src/net/richardlord/ash/integration/robotlegs/AshExtension.as
@@ -1,4 +1,5 @@
-package net.richardlord.ash.integration.robotlegs {
+package net.richardlord.ash.integration.robotlegs
+{
import net.richardlord.ash.core.Game;
import net.richardlord.ash.integration.swiftsuspenders.SwiftSuspendersGame;
@@ -11,14 +12,16 @@ package net.richardlord.ash.integration.robotlegs {
* wraps the SwiftSuspenders integration, passing the Robotlegs context's injector to
* the game for injecting into systems.
*/
- public class AshExtension implements IExtension {
- private const _uid : String = UID.create(AshExtension);
+ public class AshExtension implements IExtension
+ {
+ private const _uid : String = UID.create( AshExtension );
- public function extend(context : IContext) : void {
- context.injector.map(Game).toValue(new SwiftSuspendersGame(context.injector));
+ public function extend( context : IContext ) : void
+ {
+ context.injector.map( Game ).toValue( new SwiftSuspendersGame( context.injector ) );
}
- public function toString():String
+ public function toString() : String
{
return _uid;
}
View
15 src/net/richardlord/ash/integration/swiftsuspenders/NodeListProvider.as
@@ -20,27 +20,28 @@ package net.richardlord.ash.integration.swiftsuspenders
public class NodeListProvider implements DependencyProvider
{
private var game : Game;
-
+
public function NodeListProvider( game : Game )
{
this.game = game;
}
-
+
public function apply( targetType : Class, activeInjector : Injector, injectParameters : Dictionary ) : Object
{
- if( injectParameters["nodeType"] )
+ if ( injectParameters["nodeType"] )
{
var nodeClass : Class = getDefinitionByName( injectParameters["nodeType"] ) as Class;
- if( nodeClass )
+ if ( nodeClass )
{
return game.getNodeList( nodeClass );
}
}
return null;
}
-
- public function destroy():void{
-
+
+ public function destroy() : void
+ {
+
}
}
}

0 comments on commit 441e3c3

Please sign in to comment.
Something went wrong with that request. Please try again.