当前位置: 首页>>代码示例>>C#>>正文


C# SaveClasses.NamedObjectSave类代码示例

本文整理汇总了C#中FlatRedBall.Glue.SaveClasses.NamedObjectSave的典型用法代码示例。如果您正苦于以下问题:C# NamedObjectSave类的具体用法?C# NamedObjectSave怎么用?C# NamedObjectSave使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NamedObjectSave类属于FlatRedBall.Glue.SaveClasses命名空间,在下文中一共展示了NamedObjectSave类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        public void Initialize()
        {
            OverallInitializer.Initialize();

            mBaseEntity = new EntitySave();
            mBaseEntity.Name = "BaseEntityInheritanceTests";
            ObjectFinder.Self.GlueProject.Entities.Add(mBaseEntity);

            NamedObjectSave nos = new NamedObjectSave();
            nos.InstanceName = "SpriteInstance";
            nos.SourceType = SourceType.FlatRedBallType;
            nos.SourceClassType = "Sprite";
            nos.SetByDerived = true;
            mBaseEntity.NamedObjects.Add(nos);

            nos = new NamedObjectSave();
            nos.InstanceName = "RectInstance";
            nos.SourceType = SourceType.FlatRedBallType;
            nos.SourceClassType = "AxisAlignedRectangle";
            nos.ExposedInDerived = true;
            mBaseEntity.NamedObjects.Add(nos);

            mDerivedEntity = new EntitySave();
            mDerivedEntity.Name = "DerivedentityInheritanceTests";
            mDerivedEntity.BaseEntity = mBaseEntity.Name;
            mDerivedEntity.UpdateFromBaseType();
            ObjectFinder.Self.GlueProject.Entities.Add(mDerivedEntity);

            mDerivedElementRuntime = new ElementRuntime(mDerivedEntity, null, null, null, null);
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:30,代码来源:InheritanceTests.cs

示例2: CreateEntitySaves

        private void CreateEntitySaves()
        {
            mEntitySave = new EntitySave();
            mEntitySave.Name = "StateTestEntity";

            ObjectFinder.Self.GlueProject.Entities.Add(mEntitySave);

            CreateNamedObjectWithSetVariable();

            CreateEntityVariables();

            CreateEntitySaveState();

            mContainer = new EntitySave();
            mContainer.Name = "StateTestContainerEntity";


            NamedObjectSave nos = new NamedObjectSave();
            nos.InstanceName = mEntitySave.Name + "Instance";
            nos.SourceType = SourceType.Entity;
            nos.SourceClassType = mEntitySave.Name;
            mContainer.NamedObjects.Add(nos);


            CustomVariable stateTunnel = new CustomVariable();
            stateTunnel.SourceObject = nos.InstanceName;
            stateTunnel.SourceObjectProperty = "CurrentState";
            stateTunnel.Type = "VariableState";
            stateTunnel.Name = "StateTunnelVariable";
            mContainer.CustomVariables.Add(stateTunnel);

            CreateContainerEntityState();

        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:34,代码来源:StateTests.cs

示例3: AddVariablesForAllProperties

        public virtual void AddVariablesForAllProperties(object saveObject, NamedObjectSave toAddTo)
        {
            toAddTo.InstructionSaves.Clear();

            foreach (var field in saveObject.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance))
            {
                object currentValue = field.GetValue(saveObject);

                if (!MemberInvestigator.IsDefault(saveObject, field.Name, currentValue))
                {
                    string memberName = field.Name;

                    AddVariableToNos(toAddTo, memberName, currentValue);
                }
            }

            foreach (var property in saveObject.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                object currentValue = property.GetValue(saveObject, null);

                if (!MemberInvestigator.IsDefault(saveObject, property.Name, currentValue))
                {
                    string memberName = property.Name;

                    AddVariableToNos(toAddTo, memberName, currentValue);
                }
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:28,代码来源:GeneralSaveConverter.cs

示例4: AddVariableToNos

 protected virtual void AddVariableToNos(NamedObjectSave toReturn, string memberName, object currentValue)
 {
     CustomVariableInNamedObject cvino = new CustomVariableInNamedObject();
     cvino.Member = memberName;
     cvino.Value = currentValue;
     toReturn.InstructionSaves.Add(cvino);
 }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:7,代码来源:GeneralSaveConverter.cs

示例5: CreateContainerEntitySave

        private void CreateContainerEntitySave()
        {
            mEntitySaveInstance = new NamedObjectSave();
            mEntitySaveInstance.InstanceName = "StateEntityInstance";
            mEntitySaveInstance.SourceType = SourceType.Entity;
            mEntitySaveInstance.SourceClassType = mEntitySave.Name;

            mDerivedSaveInstance = new NamedObjectSave();
            mDerivedSaveInstance.InstanceName = "StateDerivedEntityInstance";
            mDerivedSaveInstance.SourceType = SourceType.Entity;
            mDerivedSaveInstance.SourceClassType = mDerivedEntitySave.Name;

            mContainerEntitySave = new EntitySave();
            mContainerEntitySave.Name = "StateEntityContainer";

            mContainerEntitySave.NamedObjects.Add(mEntitySaveInstance);
            mContainerEntitySave.NamedObjects.Add(mDerivedSaveInstance);


            mTunneledUncategorizedStateInContainer = new CustomVariable();
            mTunneledUncategorizedStateInContainer.Name = "TunneledUncategorizedStateVariable";
            mTunneledUncategorizedStateInContainer.SourceObject = mEntitySaveInstance.InstanceName;
            mTunneledUncategorizedStateInContainer.SourceObjectProperty = mRenamedExposedUncategorizedStateVariable.Name;
            mContainerEntitySave.CustomVariables.Add(mTunneledUncategorizedStateInContainer);


            ObjectFinder.Self.GlueProject.Entities.Add(mContainerEntitySave);

            
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:30,代码来源:StateTests.cs

示例6: PerformStandardVariableAssignments

        private static void PerformStandardVariableAssignments(NamedObjectSave instance, TypedMemberBase typedMember, object value, DataGridItem instanceMember, Type memberType)
        {
            // If we ignore the next refresh, then AnimationChains won't update when the user
            // picks an AnimationChainList from a combo box:
            //RefreshLogic.IgnoreNextRefresh();
            GlueCommands.Self.GluxCommands.SetVariableOn(
                instance,
                typedMember.MemberName,
                memberType,
                value);


            GlueCommands.Self.RefreshCommands.RefreshPropertyGrid();

            // let's make the UI faster:

            // Get this on the UI thread, but use it in the async call below
            var currentElement = GlueState.Self.CurrentElement;

            TaskManager.Self.AddAsyncTask(() =>
            {
                GlueCommands.Self.GluxCommands.SaveGlux();

                GlueCommands.Self.GenerateCodeCommands.GenerateElementCode(currentElement);
            },
            "Saving .glux and regenerating the code for the current element");
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:27,代码来源:NamedObjectVariableChangeLogic.cs

示例7: AssignTextureCoordinateValues

        private static void AssignTextureCoordinateValues(TextureCoordinateSelectionWindow selectionWindow, NamedObjectSave nos)
        {
            var texture = selectionWindow.CurrentTexture;
            var rectangle = selectionWindow.RectangleSelector;

            if (texture != null)
            {
                GlueCommands.Self.GluxCommands.SetVariableOn(
                    nos,
                    "LeftTexturePixel",
                    typeof(float),
                    rectangle.Left);

                GlueCommands.Self.GluxCommands.SetVariableOn(
                    nos,
                    "RightTexturePixel",
                    typeof(float),
                    rectangle.Right);

                GlueCommands.Self.GluxCommands.SetVariableOn(
                    nos,
                    "TopTexturePixel",
                    typeof(float),
                    rectangle.Top);

                GlueCommands.Self.GluxCommands.SetVariableOn(
                    nos,
                    "BottomTexturePixel",
                    typeof(float),
                    rectangle.Bottom);
            }
        }
开发者ID:gitter-badger,项目名称:FlatRedBall,代码行数:32,代码来源:TextureCoordinateSelectionLogic.cs

示例8: TryToRemoveInvalidState

        private static void TryToRemoveInvalidState(this GlueProjectSave glueProjectSave, bool showPopupsOnFixedErrors, IElement containingElement, NamedObjectSave nos)
        {
            if (nos.SourceType == SourceType.Entity && !string.IsNullOrEmpty(nos.SourceClassType) && !string.IsNullOrEmpty(nos.CurrentState))
            {
                EntitySave foundEntitySave = glueProjectSave.GetEntitySave(nos.SourceClassType);

                if (foundEntitySave != null)
                {
                    bool hasFoundState = false;

                    hasFoundState = foundEntitySave.GetStateRecursively(nos.CurrentState) != null;

                    if (!hasFoundState)
                    {
                        if (showPopupsOnFixedErrors)
                        {
                            MessageBox.Show("The Object " + nos.InstanceName + " in " + containingElement.Name + " uses the invalid state " + nos.CurrentState +
                                "\nRemoving this current State");
                        }

                        nos.CurrentState = null;

                    }
                }
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:26,代码来源:GlueProjectSaveExtensionMethods.cs

示例9: AdjustLayer

 private void AdjustLayer(NamedObjectSave nos, IElement element)
 {
     if (Is2D(element))
     {
         nos.Is2D = true;
     }
 }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:7,代码来源:NewNamedObjectPlugin.cs

示例10: AdjustNewNamedObject

        void AdjustNewNamedObject(NamedObjectSave nos)
        {
            IElement element = EditorLogic.CurrentElement;

            if (element != null)
            {
                if(nos.SourceType == SourceType.FlatRedBallType)
                {
                    switch (nos.SourceClassType)
                    {
                        case "Sprite":
                            AdjustSprite(nos, element);
                            break;
                        case "Circle":
                            AdjustCircle(nos, element);
                            break;
                        case "SpriteFrame":
                            AdjustSpriteFrame(nos, element);
                            break;
                        case "AxisAlignedRectangle":
                            AdjustAxisAlignedRectangle(nos, element);
                            break;
                        case "Layer":
                            AdjustLayer(nos, element);
                            break;


                    }

                }
            }

        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:33,代码来源:NewNamedObjectPlugin.cs

示例11: CreateEntitySave

        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);
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:33,代码来源:CustomVariableTests.cs

示例12: GenerateTimedEmit

 public static void GenerateTimedEmit(ICodeBlock codeBlock, NamedObjectSave nos)
 {
     if (!nos.IsDisabled && nos.AddToManagers && !nos.DefinedByBase && nos.IsEmitter())
     {
         codeBlock.Line(nos.InstanceName + ".TimedEmit();");
     }
 }
开发者ID:gitter-badger,项目名称:FlatRedBall,代码行数:7,代码来源:ParticleCodeGenerator.cs

示例13: ScalableElementRuntime

        public ScalableElementRuntime(IElement elementSave, Layer layerProvidedByContainer,
            NamedObjectSave namedObjectSave, EventHandler<VariableSetArgs> onBeforeVariableSet,
            EventHandler<VariableSetArgs> onAfterVariableSet)
            : base(elementSave, layerProvidedByContainer, namedObjectSave, onBeforeVariableSet, onAfterVariableSet)
        {

        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:7,代码来源:ScalableElementRuntime.cs

示例14: AdjustCircle

        private void AdjustCircle(NamedObjectSave nos, IElement element)
        {
            if (Is2D(element))
            {

                nos.SetPropertyValue("Radius", 16f);
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:8,代码来源:NewNamedObjectPlugin.cs

示例15: AvailableStates

        public AvailableStates(NamedObjectSave currentNamedObject, IElement currentElement, CustomVariable currentCustomVariable, StateSave currentStateSave) : base()
        {
            CurrentNamedObject = currentNamedObject;
            CurrentElement = currentElement;
            CurrentCustomVariable = currentCustomVariable;
            CurrentStateSave = currentStateSave;

        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:8,代码来源:AvailableStates.cs


注:本文中的FlatRedBall.Glue.SaveClasses.NamedObjectSave类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。