• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ObjectGenerator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Engine

 public Engine()
 {
     this.objects = new List<EnvironmentObject>();
     this.consoleRenderer = new ConsoleRenderer(WorldWidth, WorldHeight);
     this.objectGenerator = new ObjectGenerator(WorldWidth, WorldHeight);
     this.worldBounds = new Rectangle(0, 0, WorldWidth, WorldHeight);
     CollisionHandler.Initlialize(WorldWidth, WorldHeight);
 }
开发者ID:borko9696,项目名称:SoftwareUniversity,代码行数:8,代码来源:Engine.cs


示例2: Start

 void Start()
 {
     ladderLayer = LayerMask.NameToLayer("Ladder");
     gameManager = GameManager.instance ;
     objectGenerator = ObjectGenerator.instance;
     objectManager = ObjectManager.instance;
     targetSlot = objectManager.GetStartingSlot();
     targetPosition = new Vector2(objectGenerator.IndexToGlobalPosition(targetSlot).x, -objectGenerator.horizon/2);
     transform.position = targetPosition;
 }
开发者ID:DoYouEven,项目名称:LeapFramework,代码行数:10,代码来源:PlayerController.cs


示例3: Start

 // Use this for initialization
 void Start()
 {
     objectHistory = InfiniteObjectHistory.instance;
     objectManager = ObjectManager.instance;
     objectGenerator = ObjectGenerator.instance;
     inputController = InputController.instance;
     objectManager.Init();
     objectHistory.Init();
     objectGenerator.Init();
     objectGenerator.StartGame();
     inputController.StartGame();
 }
开发者ID:DoYouEven,项目名称:LeapFramework,代码行数:13,代码来源:GameManager.cs


示例4: Run

 public override void Run(string[] parameters)
 {
     string name = parameters[1];
     int health = int.Parse(parameters[2]);
     int damage = int.Parse(parameters[3]);
     var factory = new ObjectGenerator();
     var behavior = (AbstractBehavior)factory.Create(parameters[4], "Blobs.Behavior");
     var attack = (AbstractAttack)factory.Create(parameters[5], "Blobs.Attack");
     var blob = new Blob(name, health, damage, behavior, attack);
     engine.Db.AddBlob(blob);
     engine.Db.GetBlob(name).OutputMessage += engine.OnIncomingOutputMessage;
 }
开发者ID:byclops,项目名称:softuni,代码行数:12,代码来源:Create.cs


示例5: Main

        public static void Main()
        {
            var objectGenerator = new ObjectGenerator(WorldWidth, WorldHeight);
            var consoleRenderer = new ConsoleRenderer(WorldWidth, WorldHeight);
            var collisionHandler = new CollisionHandler(WorldWidth, WorldHeight);

            var engine = new EngineExtender(WorldWidth,
                WorldHeight,
                objectGenerator,
                collisionHandler,
                consoleRenderer);

            engine.Run();
        }
开发者ID:GeorgiDinev,项目名称:Projects,代码行数:14,代码来源:EnvironmentSystemMain.cs


示例6: Main

        static void Main()
        {
            var objectGenerator = new ObjectGenerator(WorldWidth, WorldHeight);
            var consoleRenderer = new ConsoleRenderer(WorldWidth, WorldHeight);
            var collisionHandler = new CollisionHandler(WorldWidth, WorldHeight);
            var keyboardController = new KeyboardController();

            var engine = new AdvancedEngine(keyboardController,
                WorldWidth,
                WorldHeight,
                objectGenerator,
                collisionHandler,
                consoleRenderer);

            engine.Run();
        }
开发者ID:bulgariamitko,项目名称:SoftUniHomeWordsAndMore,代码行数:16,代码来源:EnvironmentSystemMain.cs


示例7: Main

        static void Main()
        {
            var objectGenerator = new ObjectGenerator(WorldWidth, WorldHeight);
            var consoleRenderer = new ConsoleRenderer(WorldWidth, WorldHeight);
            var collisionHandler = new CollisionHandler(WorldWidth, WorldHeight);
            var controller = new Controller();
            controller.Pause += Controller_Pause;

            var engine = new ExtendedEngine(WorldWidth,
                WorldHeight,
                objectGenerator,
                collisionHandler,
                consoleRenderer,
                controller);

            engine.Run();
        }
开发者ID:nadiahristova,项目名称:OOP,代码行数:17,代码来源:EnvironmentSystemMain.cs


示例8: DefaultSampleObjectFactory

 // Default factory for sample objects
 private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
 {
     // Try to create a default sample object
     ObjectGenerator objectGenerator = new ObjectGenerator();
     return objectGenerator.GenerateObject(type);
 }
开发者ID:alexunique0519,项目名称:PizzaOrderApp,代码行数:7,代码来源:HelpPageSampleGenerator.cs


示例9: Start

 void Start()
 {
     objectManager = ObjectManager.instance;
     objectGenerator = ObjectGenerator.instance;
 }
开发者ID:DoYouEven,项目名称:LeapFramework,代码行数:5,代码来源:InfiniteObjectHistory.cs


示例10: GetSampleObject

        /// <summary>
        /// Gets the sample object that will be serialized by the formatters. 
        /// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create one using <see cref="ObjectGenerator"/>.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns>The sample object.</returns>
        public virtual object GetSampleObject(Type type)
        {
            object sampleObject;

            if (!SampleObjects.TryGetValue(type, out sampleObject))
            {
                // Try create a default sample object
                ObjectGenerator objectGenerator = new ObjectGenerator();
                sampleObject = objectGenerator.GenerateObject(type);
            }

            return sampleObject;
        }
开发者ID:ghosh101,项目名称:Web-Ticket-Management-Application,代码行数:19,代码来源:HelpPageSampleGenerator.cs


示例11: TestSetup

        public void TestSetup()
        {
            Mock<IEngineConfigurationType> type = new Mock<IEngineConfigurationType>();
            type.SetupGet(x => x.RegisteredType).Returns(typeof(SimpleUser));
            ObjectBuilder builder = new ObjectBuilder(type.Object);
            builder.AddAction(
                new ObjectPropertySetFromSourceAction(
                    ReflectionHelper.GetMember<SimpleUser>(x=>x.FirstName) as EngineTypePropertyMember,
                    new SimpleDataSource(mTestPropertyValue)
                    ));
            builder.AddAction(
                new ObjectPropertySetFromSourceAction(
                    ReflectionHelper.GetMember<SimpleUser>(x => x.LastName) as EngineTypePropertyMember,
                    new SimpleDataSource(mTestPropertyValue)
                    ));
            builder.AddAction(
                new ObjectPropertySetFromSourceAction(
                    ReflectionHelper.GetMember<SimpleUser>(x => x.EmailAddress) as EngineTypePropertyMember,
                    new SimpleDataSource(mTestPropertyValue)
                    ));

            Mock<IGenerationConfiguration> builderRepository = new Mock<IGenerationConfiguration>();
            builderRepository.Setup(x=>x.GetBuilderForType(typeof(SimpleUser))).Returns(builder);
            builderRepository.SetupGet(x => x.RecursionLimit).Returns(10);

            mGenerationContext = new GenerationContext(builderRepository.Object);
            mMethodGenerator = new ObjectGenerator<SimpleMethodClass>(
                mGenerationContext, builder);

            mUserGenerator = new ObjectGenerator<SimpleUser>(mGenerationContext, builder);
        }
开发者ID:KCL5South,项目名称:KCLAutoPoco,代码行数:31,代码来源:ObjectGeneratorTests.cs


示例12: Awake

 public void Awake()
 {
     instance = this;
 }
开发者ID:DoYouEven,项目名称:LeapFramework,代码行数:4,代码来源:ObjectGenerator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ObjectHandle类代码示例发布时间:2022-05-24
下一篇:
C# ObjectEntry类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap