Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- //
- // ELECTROTANK INC.
- // Copyright© 2009 Electrotank, Inc.
- // All Rights Reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////
- package com.electrotank.toolsuite.editor.world.entity {
- //----------------------------------
- // imports
- //----------------------------------
- import com.electrotank.toolsuite.editor.entity.EntityInstance;
- import flash.utils.getQualifiedClassName;
- /**
- * This class represents the basic editor entity.
- *
- * @author Matt Bolt, Electrotank© 2009
- */
- public class AbstractEditorEntity {
- //--------------------------------------------------------------------------
- //
- // Variables
- //
- //--------------------------------------------------------------------------
- /**
- * @private
- * the entity instance representing the editor entity
- */
- private var _entity:EntityInstance;
- /**
- * @private
- * the subclass name for this abstract entity
- */
- private var _className:String;
- //--------------------------------------------------------------------------
- //
- // Constructor
- //
- //--------------------------------------------------------------------------
- /**
- * <code>AbstractEditorEntity</code> Constructor.
- */
- public function AbstractEditorEntity(entity:EntityInstance) {
- _entity = entity;
- _className = findSubClass();
- }
- //--------------------------------------------------------------------------
- //
- // Methods
- //
- //--------------------------------------------------------------------------
- /**
- * @private
- * finds the subclass name of this entity
- */
- private function findSubClass():String {
- var className:String = getQualifiedClassName(this);
- return className.substring(
- className.lastIndexOf("::") + 2,
- className.length );
- }
- /**
- * This method returns the <code>String</code> representation of the object.
- *
- * @return <code>String</code>
- */
- public function toString():String {
- return "[" + _className + " - " +
- "name: " + name +
- ", id: " + id +
- "]";
- }
- //--------------------------------------------------------------------------
- //
- // Properties
- //
- //--------------------------------------------------------------------------
- /**
- * This property contains the entity instance for the world view.
- */
- public function get entity():EntityInstance {
- return _entity;
- }
- /**
- * The world-view name.
- */
- public function get name():String {
- return _entity.name;
- }
- /**
- * The world-view id.
- */
- public function get id():int {
- return _entity.id;
- }
- }
- }
Add Comment
Please, Sign In to add comment