Skip to content

Commit

Permalink
Entity -> ComponentContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
robsilv committed Aug 12, 2013
1 parent 303b4d3 commit e39cf7c
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 52 deletions.
28 changes: 28 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Simplified BSD License
======================

Copyright 2012 Unwrong Ltd. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY UNWRONG "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNWRONG OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the
authors and should not be interpreted as representing official policies, either expressed
or implied, of Unwrong.
2 changes: 2 additions & 0 deletions cadetEditor_Ext/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>



3 changes: 3 additions & 0 deletions cadetEditor_Ext/src/CadetEditor_Ext.as
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package
import cadet.components.processes.TouchInputMapping;
import cadet.components.sounds.SoundComponent;
import cadet.core.CadetScene;
import cadet.core.ComponentContainer;
import cadet.entities.ComponentFactory;

import core.app.CoreApp;
Expand All @@ -30,6 +31,8 @@ package
{
var resourceManager:ResourceManager = CoreApp.resourceManager;

resourceManager.addResource( new ComponentFactory( ComponentContainer, "Component Container" ) );

// Processes
resourceManager.addResource( new ComponentFactory( KeyboardInputMapping, "Keyboard Input Mapping", "Processes", CadetEngineIcons.Process, InputProcess ) );
resourceManager.addResource( new ComponentFactory( TouchInputMapping, "Touch Input Mapping", "Processes", CadetEngineIcons.Process, InputProcess ) );
Expand Down
1 change: 1 addition & 0 deletions cadetEditor_Ext_2DS/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>


9 changes: 3 additions & 6 deletions cadetEditor_Ext_2DS/src/CadetEditor_Ext_2DS.as
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ package
import flash.display.Sprite;

import cadet.assets.CadetEngineIcons;
import cadet.core.ComponentContainer;
import cadet.core.ICadetScene;
import cadet.entities.ComponentFactory;

import cadet2D.components.behaviours.MouseFollowBehaviour;
import cadet2D.components.core.Entity;
import cadet2D.components.materials.StandardMaterialComponent;
import cadet2D.components.particles.PDParticleSystemComponent;
import cadet2D.components.processes.InputProcess2D;
Expand All @@ -39,10 +39,7 @@ package
{
public function CadetEditor_Ext_2DS()
{
var resourceManager:ResourceManager = CoreApp.resourceManager;

// Core Component
resourceManager.addResource( new ComponentFactory( Entity, "Entity" ) );
var resourceManager:ResourceManager = CoreApp.resourceManager;

// Processes
resourceManager.addResource( new ComponentFactory( InputProcess2D, "Input Process", "Processes", CadetEngineIcons.Process, ICadetScene, 1 ) );
Expand All @@ -63,7 +60,7 @@ package
resourceManager.addResource( new ComponentFactory( TextureAtlasComponent, "TextureAtlas", "Display", CadetEngineIcons.Texture) );

// Behaviours - Core
resourceManager.addResource( new ComponentFactory( MouseFollowBehaviour, "Mouse Follow", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( MouseFollowBehaviour, "Mouse Follow", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );

// Materials
resourceManager.addResource( new ComponentFactory( StandardMaterialComponent, "StandardMaterialComponent", "Display", CadetEngineIcons.Component ) );
Expand Down
1 change: 1 addition & 0 deletions cadetEditor_Ext_2DS_Box2D/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>


30 changes: 10 additions & 20 deletions cadetEditor_Ext_2DS_Box2D/src/CadetEditor_Ext_2DS_Box2D.as
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,18 @@ package
import flash.display.Sprite;

import cadet.assets.CadetEngineIcons;
import cadet.components.behaviours.VehicleUserControlBehaviour;
import cadet.core.ComponentContainer;
import cadet.core.ICadetScene;
import cadet.entities.ComponentFactory;

import cadet2D.components.core.Entity;

import cadet2DBox2D.components.behaviours.DistanceJointBehaviour;
import cadet2DBox2D.components.behaviours.MotorbikeBehaviour;
import cadet2DBox2D.components.behaviours.PrismaticJointBehaviour;
import cadet2DBox2D.components.behaviours.RevoluteJointBehaviour;
import cadet2DBox2D.components.behaviours.RigidBodyBehaviour;
import cadet2DBox2D.components.behaviours.RigidBodyCollisionDetectBehaviour;
import cadet2DBox2D.components.behaviours.RigidBodyMouseDragBehaviour;
import cadet2DBox2D.components.behaviours.SimpleVehicleBehaviour;
import cadet2DBox2D.components.behaviours.SpringBehaviour;
import cadet2DBox2D.components.behaviours.VehicleBehaviour;
import cadet2DBox2D.components.processes.DebugDrawProcess;
import cadet2DBox2D.components.processes.PhysicsProcess;

import core.app.CoreApp;
Expand All @@ -42,23 +38,17 @@ package

// Processes
resourceManager.addResource( new ComponentFactory( PhysicsProcess, "Physics", "Processes", CadetEngineIcons.Process, ICadetScene, 1 ) );
resourceManager.addResource( new ComponentFactory( DebugDrawProcess, "Debug Draw Process", "Processes", CadetEngineIcons.Process, ICadetScene, 1 ) );

// Behaviours
resourceManager.addResource( new ComponentFactory( RigidBodyBehaviour, "Rigid Body", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( RigidBodyMouseDragBehaviour, "Mouse Drag", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( RigidBodyCollisionDetectBehaviour, "RB Collision Detect", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );

resourceManager.addResource( new ComponentFactory( DistanceJointBehaviour, "Distance Joint", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( SpringBehaviour, "Spring Joint", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( RevoluteJointBehaviour, "Revolute Joint", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( PrismaticJointBehaviour, "Prismatic Joint", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( RigidBodyBehaviour, "Rigid Body", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( RigidBodyMouseDragBehaviour, "Mouse Drag", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( RigidBodyCollisionDetectBehaviour, "RB Collision Detect", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );

resourceManager.addResource( new ComponentFactory( SimpleVehicleBehaviour, "Simple Vehicle", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( VehicleBehaviour, "Vehicle", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( MotorbikeBehaviour, "Motorbike", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );

// Doesn't really belong here..
resourceManager.addResource( new ComponentFactory( VehicleUserControlBehaviour, "Vehicle User Control", "Behaviours", CadetEngineIcons.Behaviour, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( DistanceJointBehaviour, "Distance Joint", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( SpringBehaviour, "Spring Joint", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( RevoluteJointBehaviour, "Revolute Joint", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( PrismaticJointBehaviour, "Prismatic Joint", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
}
}
}
1 change: 1 addition & 0 deletions cadetEditor_Ext_2DS_Geom/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@
<buildCSSFiles/>
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>

36 changes: 23 additions & 13 deletions cadetEditor_Ext_2DS_Geom/src/CadetEditor_Ext_2DS_Geom.as
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package
import flash.display.Sprite;

import cadet.assets.CadetEngineIcons;
import cadet.core.ComponentContainer;
import cadet.entities.ComponentFactory;

import cadet2D.components.core.Entity;
import cadet2D.components.connections.Connection;
import cadet2D.components.connections.Pin;
import cadet2D.components.geom.BoundingSphere;
import cadet2D.components.geom.CircleGeometry;
import cadet2D.components.geom.CompoundGeometry;
Expand All @@ -15,7 +17,9 @@ package
import cadet2D.components.geom.TriangleGeometry;
import cadet2D.components.skins.ConnectionSkin;
import cadet2D.components.skins.GeometrySkin;
import cadet2D.components.skins.PinSkin;
import cadet2D.components.skins.SpringSkin;
import cadet2D.components.skins.TerrainSkin;

import core.app.CoreApp;
import core.app.managers.ResourceManager;
Expand All @@ -27,21 +31,27 @@ package
var resourceManager:ResourceManager = CoreApp.resourceManager;

// Geometry
resourceManager.addResource( new ComponentFactory( RectangleGeometry, "Rectangle", "Geometry", CadetEngineIcons.Geometry, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( TriangleGeometry, "Triangle", "Geometry", CadetEngineIcons.Geometry, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( CircleGeometry, "Circle", "Geometry", CadetEngineIcons.Geometry, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( PolygonGeometry, "Polygon", "Geometry", CadetEngineIcons.Geometry, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( CompoundGeometry, "Compound Geometry", "Geometry", CadetEngineIcons.Geometry, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( TerrainGeometry, "Terrain Geometry", "Geometry", CadetEngineIcons.Geometry, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( RectangleGeometry, "Rectangle", "Geometry", CadetEngineIcons.Geometry, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( TriangleGeometry, "Triangle", "Geometry", CadetEngineIcons.Geometry, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( CircleGeometry, "Circle", "Geometry", CadetEngineIcons.Geometry, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( PolygonGeometry, "Polygon", "Geometry", CadetEngineIcons.Geometry, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( CompoundGeometry, "Compound Geometry", "Geometry", CadetEngineIcons.Geometry, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( BoundingSphere, "Bounding Sphere", "Geometry", CadetEngineIcons.Geometry, null, 1 ) );

// Graphics Skins
resourceManager.addResource( new ComponentFactory( GeometrySkin, "Geometry Skin", "Display", CadetEngineIcons.Skin, Entity, 1 ) );
// resourceManager.addResource( new ComponentFactory( GeometryDebugSkin, "Geometry Debug Skin", "Skins", CadetEngineIcons.Skin, Entity, 1 ) );
// resourceManager.addResource( new ComponentFactory( FractalPolygonSkin, "Fractal Polygon Skin", "Skins", CadetEngineIcons.Skin, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( ConnectionSkin, "Connection Skin", "Display", CadetEngineIcons.Skin, Entity, 1 ) );
resourceManager.addResource( new ComponentFactory( SpringSkin, "Spring Skin", "Display", CadetEngineIcons.Skin, Entity, 1 ) );

resourceManager.addResource( new ComponentFactory( GeometrySkin, "Geometry Skin", "Display", CadetEngineIcons.Skin, ComponentContainer, 1 ) );
// resourceManager.addResource( new ComponentFactory( GeometryDebugSkin, "Geometry Debug Skin", "Skins", CadetEngineIcons.Skin, ComponentContainer, 1 ) );
// resourceManager.addResource( new ComponentFactory( FractalPolygonSkin, "Fractal Polygon Skin", "Skins", CadetEngineIcons.Skin, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( ConnectionSkin, "Connection Skin", "Display", CadetEngineIcons.Skin, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( SpringSkin, "Spring Skin", "Display", CadetEngineIcons.Skin, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( PinSkin, "Pin Skin", "Display", CadetEngineIcons.Skin, ComponentContainer, 1 ) );

resourceManager.addResource( new ComponentFactory( Pin, "Pin", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( Connection, "Connection", "Behaviours", CadetEngineIcons.Behaviour, ComponentContainer, 1 ) );

// Specific implementation: doesn't belong here.
resourceManager.addResource( new ComponentFactory( TerrainGeometry, "Terrain Geometry", "Geometry", CadetEngineIcons.Geometry, ComponentContainer, 1 ) );
resourceManager.addResource( new ComponentFactory( TerrainSkin, "Terrain Skin", "Display", CadetEngineIcons.Skin, ComponentContainer, 1 ) );
}
}
}
1 change: 1 addition & 0 deletions cadetEditor_Ext_3D/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>


26 changes: 13 additions & 13 deletions cadetEditor_Ext_3D/src/CadetEditor_Ext_3D.as
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ package

// Entities =======================================
// Cameras
resourceManager.addResource( new ComponentFactory( CameraComponent, "Camera", "Entities", CadetEngine3DIcons.Camera ) );
resourceManager.addResource( new ComponentFactory( CameraComponent, "Camera", "Display", CadetEngine3DIcons.Camera ) );
// Debug
resourceManager.addResource( new ComponentFactory( TridentComponent, "Trident", "Entities", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( TridentComponent, "Trident", "Display", CadetEngine3DIcons.Mesh ) );
// Entities
resourceManager.addResource( new ComponentFactory( MeshComponent, "Mesh", "Entities", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( ObjectContainer3DComponent, "ObjectContainer3D", "Entities", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( SkyBoxComponent, "SkyBox", "Entities", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( Sprite3DComponent, "Sprite3D", "Entities", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( MeshComponent, "Mesh", "Display", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( ObjectContainer3DComponent, "ObjectContainer3D", "Display", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( SkyBoxComponent, "SkyBox", "Display", CadetEngine3DIcons.Mesh ) );
resourceManager.addResource( new ComponentFactory( Sprite3DComponent, "Sprite3D", "Display", CadetEngine3DIcons.Mesh ) );

// Geometries =====================================
// resourceManager.addResource( new ComponentFactory( HeightmapGeometryComponent, "HeightmapGeometry", "Geometry", CadetEngine3DIcons.Geometry ) );
Expand All @@ -69,22 +69,22 @@ package
resourceManager.addResource( new ComponentFactory( CubeGeometryComponent, "CubeGeometry", "Geometry", CadetEngine3DIcons.Geometry ) );

// Lights =========================================
resourceManager.addResource( new ComponentFactory( DirectionalLightComponent, "Directional Light", "Entities", CadetEngine3DIcons.DirectionalLight ) );
resourceManager.addResource( new ComponentFactory( PointLightComponent, "Point Light", "Entities", CadetEngine3DIcons.PointLight ) );
resourceManager.addResource( new ComponentFactory( DirectionalLightComponent, "Directional Light", "Display", CadetEngine3DIcons.DirectionalLight ) );
resourceManager.addResource( new ComponentFactory( PointLightComponent, "Point Light", "Display", CadetEngine3DIcons.PointLight ) );

// Materials ======================================
resourceManager.addResource( new ComponentFactory( ColorMaterialComponent, "Color Material", "Materials", CadetEngine3DIcons.Material ) );
resourceManager.addResource( new ComponentFactory( SkyBoxMaterialComponent, "SkyBox Material", "Materials", CadetEngine3DIcons.Material ) );
resourceManager.addResource( new ComponentFactory( TextureMaterialComponent, "Texture Material", "Materials", CadetEngine3DIcons.Material ) );
resourceManager.addResource( new ComponentFactory( ColorMaterialComponent, "Color Material", "Display", CadetEngine3DIcons.Material ) );
resourceManager.addResource( new ComponentFactory( SkyBoxMaterialComponent, "SkyBox Material", "Display", CadetEngine3DIcons.Material ) );
resourceManager.addResource( new ComponentFactory( TextureMaterialComponent, "Texture Material", "Display", CadetEngine3DIcons.Material ) );

// Processes ======================================
resourceManager.addResource( new ComponentFactory( InputProcess3D, "Input Process", "Processes", CadetEngineIcons.Process, ICadetScene, 1 ) );
resourceManager.addResource( new ComponentFactory( HoverCamProcess, "HoverCamProcess", "Processes", CadetEngineIcons.Process, ICadetScene, 1 ) );
resourceManager.addResource( new ComponentFactory( Renderer3D, "Away3D Renderer", "Processes", CadetEngine3DIcons.Renderer, ICadetScene, 1 ) );

// Textures =======================================
resourceManager.addResource( new ComponentFactory( BitmapTextureComponent, "Bitmap Texture", "Textures", CadetEngineIcons.Texture ) );
resourceManager.addResource( new ComponentFactory( BitmapCubeTextureComponent, "Bitmap Cube Texture", "Textures", CadetEngineIcons.Texture ) );
resourceManager.addResource( new ComponentFactory( BitmapTextureComponent, "Bitmap Texture", "Display", CadetEngineIcons.Texture ) );
resourceManager.addResource( new ComponentFactory( BitmapCubeTextureComponent, "Bitmap Cube Texture", "Display", CadetEngineIcons.Texture ) );

}
}
Expand Down
1 change: 1 addition & 0 deletions cadetEditor_Ext_3D_APhysics/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>


0 comments on commit e39cf7c

Please sign in to comment.