Exemplo n.º 1
0
        public T GetObjectFromID <T>(Guid ID, GameBaseObject baseObject) where T : GameBaseObject
        {
            if (baseObject.Relationships == null)
            {
                baseObject.Relationships = new List <GameObjectRelationship>();
            }

            // get child nodes
            var childObjects = GetChildObjects(baseObject);

            // check if they are the searched for node
            foreach (var gameObject in childObjects)
            {
                if (CheckObjectID(ID, gameObject))
                {
                    return((T)gameObject);
                }

                return(GetObjectFromID <T>(ID, gameObject));
            }

            // when there are no more child objects, return null - the desired object obviously doesn't
            // exist
            return(null);
        }
Exemplo n.º 2
0
        public T GetObjectFromName <T>(string objectName, GameBaseObject baseObject) where T : GameBaseObject
        {
            if (baseObject.Relationships == null)
            {
                baseObject.Relationships = new List <GameObjectRelationship>();
            }

            // get child objects
            var childObjects = GetChildObjects(baseObject);

            // check if they are the searched for node
            foreach (var gameObject in childObjects)
            {
                if (CheckObjectName(objectName, gameObject))
                {
                    return(gameObject as T);
                }
                if (CheckObjectName(objectName, GetObjectFromName <T>(objectName, gameObject)))
                {
                    return(GetObjectFromName <T>(objectName, gameObject));
                }
            }

            // when there are no more child objects, return null - the desired object obviously doesn't
            // exist
            return(null);
        }
Exemplo n.º 3
0
        private void RemoveDirectPossessionRelationships(GameBaseObject gameobject)
        {
            var directPossessionRelationships = gameobject.Relationships.Where(relationship => relationship.RelationshipDirection == RelationshipDirection.ChildToParent && (relationship.RelationshipType == RelationshipType.Contains || relationship.RelationshipType == RelationshipType.IsUnder || relationship.RelationshipType == RelationshipType.LeadsTo || relationship.RelationshipType == RelationshipType.IsHeldBy)).ToList();

            foreach (var relationship in directPossessionRelationships)
            {
                gameobject.RemoveRelationship(relationship);
            }
        }
        /// <summary>
        /// Container Class for all the properties for organization.
        /// </summary>
        /// <param name="c"></param>
        public TorqueScriptTemplate(ref dnTorque c)
            {
            m_ts = c;
            _mConsoleobject = new ConsoleObject(ref c);
            _mMathobject = new tMath(ref c);
            	_mUtil = new UtilObject(ref c);
	_mHTTPObject = new HTTPObjectObject(ref c);
	_mTCPObject = new TCPObjectObject(ref c);
	_mDynamicConsoleMethodComponent = new DynamicConsoleMethodComponentObject(ref c);
	_mSimComponent = new SimComponentObject(ref c);
	_mArrayObject = new ArrayObjectObject(ref c);
	_mConsoleLogger = new ConsoleLoggerObject(ref c);
	_mFieldBrushObject = new FieldBrushObjectObject(ref c);
	_mPersistenceManager = new PersistenceManagerObject(ref c);
	_mSimDataBlock = new SimDataBlockObject(ref c);
	_mSimObject = new SimObjectObject(ref c);
	_mSimPersistSet = new SimPersistSetObject(ref c);
	_mSimSet = new SimSetObject(ref c);
	_mSimXMLDocument = new SimXMLDocumentObject(ref c);
	_mFileObject = new FileObjectObject(ref c);
	_mFileStreamObject = new FileStreamObjectObject(ref c);
	_mStreamObject = new StreamObjectObject(ref c);
	_mZipObject = new ZipObjectObject(ref c);
	_mDecalRoad = new DecalRoadObject(ref c);
	_mMeshRoad = new MeshRoadObject(ref c);
	_mRiver = new RiverObject(ref c);
	_mScatterSky = new ScatterSkyObject(ref c);
	_mSkyBox = new SkyBoxObject(ref c);
	_mSun = new SunObject(ref c);
	_mGuiRoadEditorCtrl = new GuiRoadEditorCtrlObject(ref c);
	_mForest = new ForestObject(ref c);
	_mForestWindEmitter = new ForestWindEmitterObject(ref c);
	_mForestBrush = new ForestBrushObject(ref c);
	_mForestBrushTool = new ForestBrushToolObject(ref c);
	_mForestEditorCtrl = new ForestEditorCtrlObject(ref c);
	_mForestSelectionTool = new ForestSelectionToolObject(ref c);
	_mCubemapData = new CubemapDataObject(ref c);
	_mDebugDrawer = new DebugDrawerObject(ref c);
	_mGuiTSCtrl = new GuiTSCtrlObject(ref c);
	_mGuiBitmapButtonCtrl = new GuiBitmapButtonCtrlObject(ref c);
	_mGuiButtonBaseCtrl = new GuiButtonBaseCtrlObject(ref c);
	_mGuiCheckBoxCtrl = new GuiCheckBoxCtrlObject(ref c);
	_mGuiIconButtonCtrl = new GuiIconButtonCtrlObject(ref c);
	_mGuiSwatchButtonCtrl = new GuiSwatchButtonCtrlObject(ref c);
	_mGuiToolboxButtonCtrl = new GuiToolboxButtonCtrlObject(ref c);
	_mGuiAutoScrollCtrl = new GuiAutoScrollCtrlObject(ref c);
	_mGuiDynamicCtrlArrayControl = new GuiDynamicCtrlArrayControlObject(ref c);
	_mGuiFormCtrl = new GuiFormCtrlObject(ref c);
	_mGuiFrameSetCtrl = new GuiFrameSetCtrlObject(ref c);
	_mGuiPaneControl = new GuiPaneControlObject(ref c);
	_mGuiRolloutCtrl = new GuiRolloutCtrlObject(ref c);
	_mGuiScrollCtrl = new GuiScrollCtrlObject(ref c);
	_mGuiStackControl = new GuiStackControlObject(ref c);
	_mGuiTabBookCtrl = new GuiTabBookCtrlObject(ref c);
	_mGuiBitmapCtrl = new GuiBitmapCtrlObject(ref c);
	_mGuiColorPickerCtrl = new GuiColorPickerCtrlObject(ref c);
	_mGuiDirectoryFileListCtrl = new GuiDirectoryFileListCtrlObject(ref c);
	_mGuiFileTreeCtrl = new GuiFileTreeCtrlObject(ref c);
	_mGuiGameListMenuCtrl = new GuiGameListMenuCtrlObject(ref c);
	_mGuiGameListOptionsCtrl = new GuiGameListOptionsCtrlObject(ref c);
	_mGuiGradientCtrl = new GuiGradientCtrlObject(ref c);
	_mGuiListBoxCtrl = new GuiListBoxCtrlObject(ref c);
	_mGuiMaterialCtrl = new GuiMaterialCtrlObject(ref c);
	_mGuiMLTextCtrl = new GuiMLTextCtrlObject(ref c);
	_mGuiPopUpMenuCtrl = new GuiPopUpMenuCtrlObject(ref c);
	_mGuiPopUpMenuCtrlEx = new GuiPopUpMenuCtrlExObject(ref c);
	_mGuiSliderCtrl = new GuiSliderCtrlObject(ref c);
	_mGuiTabPageCtrl = new GuiTabPageCtrlObject(ref c);
	_mGuiTextCtrl = new GuiTextCtrlObject(ref c);
	_mGuiTextEditCtrl = new GuiTextEditCtrlObject(ref c);
	_mGuiTextListCtrl = new GuiTextListCtrlObject(ref c);
	_mGuiTreeViewCtrl = new GuiTreeViewCtrlObject(ref c);
	_mGuiCanvas = new GuiCanvasObject(ref c);
	_mGuiControl = new GuiControlObject(ref c);
	_mGuiControlProfile = new GuiControlProfileObject(ref c);
	_mDbgFileView = new DbgFileViewObject(ref c);
	_mGuiEditCtrl = new GuiEditCtrlObject(ref c);
	_mGuiFilterCtrl = new GuiFilterCtrlObject(ref c);
	_mGuiGraphCtrl = new GuiGraphCtrlObject(ref c);
	_mGuiImageList = new GuiImageListObject(ref c);
	_mGuiInspector = new GuiInspectorObject(ref c);
	_mGuiInspectorTypeFileName = new GuiInspectorTypeFileNameObject(ref c);
	_mGuiInspectorTypeBitMask32 = new GuiInspectorTypeBitMask32Object(ref c);
	_mGuiMenuBar = new GuiMenuBarObject(ref c);
	_mGuiParticleGraphCtrl = new GuiParticleGraphCtrlObject(ref c);
	_mGuiShapeEdPreview = new GuiShapeEdPreviewObject(ref c);
	_mGuiInspectorDynamicField = new GuiInspectorDynamicFieldObject(ref c);
	_mGuiInspectorDynamicGroup = new GuiInspectorDynamicGroupObject(ref c);
	_mGuiInspectorField = new GuiInspectorFieldObject(ref c);
	_mGuiVariableInspector = new GuiVariableInspectorObject(ref c);
	_mGuiMessageVectorCtrl = new GuiMessageVectorCtrlObject(ref c);
	_mGuiProgressBitmapCtrl = new GuiProgressBitmapCtrlObject(ref c);
	_mGuiTickCtrl = new GuiTickCtrlObject(ref c);
	_mGuiTheoraCtrl = new GuiTheoraCtrlObject(ref c);
	_mMessageVector = new MessageVectorObject(ref c);
	_mEditTSCtrl = new EditTSCtrlObject(ref c);
	_mGuiMissionAreaCtrl = new GuiMissionAreaCtrlObject(ref c);
	_mMECreateUndoAction = new MECreateUndoActionObject(ref c);
	_mMEDeleteUndoAction = new MEDeleteUndoActionObject(ref c);
	_mWorldEditor = new WorldEditorObject(ref c);
	_mLangTable = new LangTableObject(ref c);
	_mPathedInterior = new PathedInteriorObject(ref c);
	_mMaterial = new MaterialObject(ref c);
	_mSimResponseCurve = new SimResponseCurveObject(ref c);
	_mMenuBar = new MenuBarObject(ref c);
	_mPopupMenu = new PopupMenuObject(ref c);
	_mFileDialog = new FileDialogObject(ref c);
	_mPostEffect = new PostEffectObject(ref c);
	_mRenderBinManager = new RenderBinManagerObject(ref c);
	_mRenderPassManager = new RenderPassManagerObject(ref c);
	_mRenderPassStateToken = new RenderPassStateTokenObject(ref c);
	_mSceneObject = new SceneObjectObject(ref c);
	_mSFXController = new SFXControllerObject(ref c);
	_mSFXParameter = new SFXParameterObject(ref c);
	_mSFXProfile = new SFXProfileObject(ref c);
	_mSFXSource = new SFXSourceObject(ref c);
	_mActionMap = new ActionMapObject(ref c);
	_mNetConnection = new NetConnectionObject(ref c);
	_mNetObject = new NetObjectObject(ref c);
	_mAIClient = new AIClientObject(ref c);
	_mAIConnection = new AIConnectionObject(ref c);
	_mAIPlayer = new AIPlayerObject(ref c);
	_mCamera = new CameraObject(ref c);
	_mDebris = new DebrisObject(ref c);
	_mGroundPlane = new GroundPlaneObject(ref c);
	_mGuiMaterialPreview = new GuiMaterialPreviewObject(ref c);
	_mGuiObjectView = new GuiObjectViewObject(ref c);
	_mItem = new ItemObject(ref c);
	_mLightBase = new LightBaseObject(ref c);
	_mLightDescription = new LightDescriptionObject(ref c);
	_mLightFlareData = new LightFlareDataObject(ref c);
	_mMissionArea = new MissionAreaObject(ref c);
	_mSpawnSphere = new SpawnSphereObject(ref c);
	_mPathCamera = new PathCameraObject(ref c);
	_mPhysicalZone = new PhysicalZoneObject(ref c);
	_mPlayer = new PlayerObject(ref c);
	_mPortal = new PortalObject(ref c);
	_mProjectile = new ProjectileObject(ref c);
	_mProximityMine = new ProximityMineObject(ref c);
	_mShapeBaseData = new ShapeBaseDataObject(ref c);
	_mShapeBase = new ShapeBaseObject(ref c);
	_mStaticShape = new StaticShapeObject(ref c);
	_mTrigger = new TriggerObject(ref c);
	_mTSStatic = new TSStaticObject(ref c);
	_mZone = new ZoneObject(ref c);
	_mRenderMeshExample = new RenderMeshExampleObject(ref c);
	_mLightning = new LightningObject(ref c);
	_mParticleData = new ParticleDataObject(ref c);
	_mParticleEmitterData = new ParticleEmitterDataObject(ref c);
	_mParticleEmitterNode = new ParticleEmitterNodeObject(ref c);
	_mPrecipitation = new PrecipitationObject(ref c);
	_mGameBase = new GameBaseObject(ref c);
	_mGameConnection = new GameConnectionObject(ref c);
	_mPhysicsDebrisData = new PhysicsDebrisDataObject(ref c);
	_mPhysicsForce = new PhysicsForceObject(ref c);
	_mPhysicsShape = new PhysicsShapeObject(ref c);
	_mAITurretShape = new AITurretShapeObject(ref c);
	_mTurretShape = new TurretShapeObject(ref c);
	_mFlyingVehicle = new FlyingVehicleObject(ref c);
	_mWheeledVehicle = new WheeledVehicleObject(ref c);
	_mTerrainBlock = new TerrainBlockObject(ref c);
	_mSettings = new SettingsObject(ref c);
	_mCompoundUndoAction = new CompoundUndoActionObject(ref c);
	_mUndoManager = new UndoManagerObject(ref c);
	_mUndoAction = new UndoActionObject(ref c);
	_mEventManager = new EventManagerObject(ref c);
	_mMessage = new MessageObject(ref c);
}
Exemplo n.º 5
0
 private static bool CheckObjectID(Guid ID, GameBaseObject baseObject)
 {
     return(baseObject.ID == ID);
 }
Exemplo n.º 6
0
 private static bool CheckObjectName(string objectName, GameBaseObject baseObject)
 {
     return(baseObject != null && baseObject.Name == objectName);
 }
Exemplo n.º 7
0
 public static List <GameBaseObject> GetChildObjects(GameBaseObject baseObject)
 {
     return((from objectRelationship in baseObject.Relationships where objectRelationship.RelationshipDirection == RelationshipDirection.ParentToChild && (objectRelationship.RelationshipType == RelationshipType.Contains || objectRelationship.RelationshipType == RelationshipType.IsHeldBy || objectRelationship.RelationshipType == RelationshipType.IsUnder) select objectRelationship.RelationshipTo).ToList());
 }