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


C# NamedObjectSave.GetQualifiedClassType方法代码示例

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


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

示例1: GenerateInstantiationOrAssignment


//.........这里部分代码省略.........
                        }
                        else
                        {
                            succeeded = false;
                        }
                    }



                    if ((string.IsNullOrEmpty(namedObject.SourceName) || namedObject.SourceName == "<NONE>") &&
                        FileManager.GetExtension(namedObject.SourceFile) != "srgx")
                    {
                        succeeded = false;
                    }
                    #endregion

                    if (succeeded)
                    {
                        string containerName = overridingName;
                        if (rfs != null)
                        {
                            containerName = rfs.GetInstanceName();// FileManager.RemovePath(FileManager.RemoveExtension(namedObject.SourceFile));
                        }

                        List<StateSave> statesUsingThisNamedObject = saveObject.GetAllStatesReferencingObject(objectName);

                        if (statesUsingThisNamedObject.Count != 0)
                        {
                            InstantiateObjectInSwitchStatement(namedObject, codeBlock, referencedFilesAlreadyUsingFullFile,
                                nosAti, objectName, rfs, statesUsingThisNamedObject, saveObject, containerName, null);
                        }
                        else
                        {
                            InstantiateObjectUsingFile(namedObject, codeBlock, referencedFilesAlreadyUsingFullFile, nosAti, objectName, rfs, saveObject, containerName, overridingName);
                        }
                    }
                }
            }

            #endregion

            else if (namedObject.SourceType == SourceType.FlatRedBallType)
            {
                // We treat Cameras in a special way:
                if (namedObject.ClassType == "Camera")
                {
                    if (namedObject.IsNewCamera)
                    {
                        string contentManagerNameString = "ContentManagerName";
                        codeBlock.Line(objectName + " = new FlatRedBall.Camera(" + contentManagerNameString + ");");
                        codeBlock.Line("FlatRedBall.SpriteManager.Cameras.Add(" + objectName + ");");
                    }
                    else
                    {
                        codeBlock.Line(objectName + " = FlatRedBall.SpriteManager.Camera;");

                    }
                }
                else if (namedObject.IsContainer)
                {
                    codeBlock.Line(objectName + " = this;");
                }
                else
                {
                    string qualifiedName = namedObject.GetQualifiedClassType();

                    if (namedObject.GetAssetTypeInfo() != null)
                    {
                        qualifiedName = namedObject.GetAssetTypeInfo().QualifiedRuntimeTypeName.QualifiedType;
                    }


                    codeBlock.Line(string.Format("{0} = new {1}();", objectName, qualifiedName));

                    if (namedObject.IsLayer || 
                        namedObject.SourceType == SourceType.FlatRedBallType)
                    {
                        codeBlock.Line(string.Format("{0}.Name = \"{1}\";", objectName, objectName));
                    }
                }


            }



            #region else if SourceType is Entity

            else // SourceType == SourceType.Entity
            {
                codeBlock.Line(string.Format("{0} = new {1}(ContentManagerName, false);", objectName,
                                             GetQualifiedTypeName(namedObject)));
                codeBlock.Line(string.Format("{0}.Name = \"{1}\";", objectName, objectName));
                // If it's an Entity List that references a List that can be created by Entities, then the Screen should register this list with the factory

            }

            #endregion
            return succeeded;
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:101,代码来源:NamedObjectSaveCodeGenerator.cs

示例2: GetQualifiedTypeName

        public static string GetQualifiedTypeName(NamedObjectSave namedObjectSave)
        {
            if (namedObjectSave.SourceType == SaveClasses.SourceType.Entity &&
                !string.IsNullOrEmpty(namedObjectSave.SourceClassType))
            {

                return ProjectManager.ProjectNamespace + '.' + namedObjectSave.SourceClassType.Replace('\\', '.');
            }
            else if (namedObjectSave.GetAssetTypeInfo() != null)
            {
                return namedObjectSave.GetAssetTypeInfo().QualifiedRuntimeTypeName.QualifiedType;
            }
            else
            {
                return namedObjectSave.GetQualifiedClassType();
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:17,代码来源:NamedObjectSaveCodeGenerator.cs


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