private void CreateEntitySave()
        {
            mEntitySave = ExposedVariableTests.CreateEntitySaveWithStates("CustomVariableEntity");
            mExposedStateInCategoryVariable              = new CustomVariable();
            mExposedStateInCategoryVariable.Name         = "CurrentStateCategoryState";
            mExposedStateInCategoryVariable.Type         = "StateCategory";
            mExposedStateInCategoryVariable.SetByDerived = true;
            mEntitySave.CustomVariables.Add(mExposedStateInCategoryVariable);

            mSetByDerivedVariable              = new CustomVariable();
            mSetByDerivedVariable.Type         = "float";
            mSetByDerivedVariable.Name         = "SomeVariable";
            mSetByDerivedVariable.SetByDerived = true;
            mEntitySave.CustomVariables.Add(mSetByDerivedVariable);

            mTextInBase = new NamedObjectSave();
            mTextInBase.InstanceName    = "TextObject";
            mTextInBase.SourceType      = SourceType.FlatRedBallType;
            mTextInBase.SourceClassType = "Text";
            mEntitySave.NamedObjects.Add(mTextInBase);


            CustomVariable customVariable = new CustomVariable();

            customVariable.Name                   = "TunneledDisplayText";
            customVariable.SourceObject           = mTextInBase.InstanceName;
            customVariable.SourceObjectProperty   = "DisplayText";
            customVariable.Type                   = "string";
            customVariable.OverridingPropertyType = "int";
            mEntitySave.CustomVariables.Add(customVariable);


            ObjectFinder.Self.GlueProject.Entities.Add(mEntitySave);
        }
Example #2
0
        private void CreateEntitySave()
        {
            mEntitySave = ExposedVariableTests.CreateEntitySaveWithStates("StateEntity");
            ObjectFinder.Self.GlueProject.Entities.Add(mEntitySave);

            mExposedStateVariable              = new CustomVariable();
            mExposedStateVariable.Name         = "CurrentState";
            mExposedStateVariable.Type         = "VariableState";
            mExposedStateVariable.SetByDerived = true;
            mEntitySave.CustomVariables.Add(mExposedStateVariable);

            mExposedStateInCategoryVariable              = new CustomVariable();
            mExposedStateInCategoryVariable.Name         = "CurrentStateCategoryState";
            mExposedStateInCategoryVariable.Type         = "StateCategory";
            mExposedStateInCategoryVariable.SetByDerived = true;
            mEntitySave.CustomVariables.Add(mExposedStateInCategoryVariable);

            mRenamedExposedUncategorizedStateVariable              = new CustomVariable();
            mRenamedExposedUncategorizedStateVariable.Name         = "RenamedVariable";
            mRenamedExposedUncategorizedStateVariable.Type         = "VariableState";
            mRenamedExposedUncategorizedStateVariable.SetByDerived = true;
            mEntitySave.CustomVariables.Add(mRenamedExposedUncategorizedStateVariable);

            mRenamedExposedCategorizedStateVariable      = new CustomVariable();
            mRenamedExposedCategorizedStateVariable.Name = "RenamedCategorizedVariable";
            mRenamedExposedCategorizedStateVariable.Type = "StateCategory";
            mEntitySave.CustomVariables.Add(mRenamedExposedCategorizedStateVariable);

            // Let's add some states now
            StateSave stateSave = new StateSave();

            stateSave.Name = "FirstState";
            mEntitySave.States.Add(stateSave);

            stateSave      = new StateSave();
            stateSave.Name = "SecondState";
            mEntitySave.States.Add(stateSave);

            StateSaveCategory category = new StateSaveCategory();

            category.Name = "SharedVariableCategory";
            mEntitySave.StateCategoryList.Add(category);

            stateSave      = new StateSave();
            stateSave.Name = "SharedStateSave";
            category.States.Add(stateSave);
        }