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


C# Memory.SetValue方法代码示例

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


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

示例1: InitializeForEor

 private static void InitializeForEor(ProgrammingModel model, Memory memory)
 {
     model.GetRegister(RegisterName.A).SetValue(0x0A);
       model.GetRegister(RegisterName.X).SetValue(0x10);
       model.GetRegister(RegisterName.Y).SetValue(0x10);
       memory.SetValue(0x1000, 0xFF);
       memory.SetValue(0x10, 0xFF);
       memory.SetValue(0x21, 0x10);
 }
开发者ID:joshpeterson,项目名称:mos,代码行数:9,代码来源:IntegrationTests.cs

示例2: Enter

    public override IEnumerator Enter(Machine owner, Brain controller)
    {
        mainMachine = owner;
        myBrain = controller;
        Legs myLeg = myBrain.legs;

        //get sheep target
        sheepTarget = myBrain.memory.GetValue<SensedObject>("hasCommand");

        sheepBrain = (Brain)sheepTarget.getObject().GetComponent("Brain");
        sheepMemory = sheepBrain.memory;
        sheepMemory.SetValue("BeingEaten", true);

        arriveBehaviour = new Arrive();

        arriveBehaviour.Init(myLeg);

        arriveBehaviour.setTarget(sheepTarget.getObject());

        //speed is zero
        myBrain.legs.maxSpeed = 0f;

        Debug.Log("I'm eating:" + sheepTarget.getObject() + " HP: " + sheepMemory.GetValue<float>("HP"));

        yield return null;
    }
开发者ID:Syclamoth,项目名称:GamesAI6,代码行数:26,代码来源:Wolf_eating.cs

示例3: CanSetAndGetAtAnAddress

        public void CanSetAndGetAtAnAddress()
        {
            const ushort address = 0x34FA;
              const byte value = 251;

              var memory = new Memory();

              memory.SetValue(address, value);
              Assert.That(memory.GetValue(address), Is.EqualTo(value));
        }
开发者ID:joshpeterson,项目名称:mos,代码行数:10,代码来源:MemoryTests.cs

示例4: SetUp

        public void SetUp()
        {
            const byte expectedCode = 0xEA; // Nop opcode

              var model = new ProgrammingModel();
              model.GetRegister(RegisterName.PC).SetValue(InstructionAddress);

              memory = new Memory();
              memory.SetValue(InstructionAddress, expectedCode);

              instruction = new InstructionTestDouble();
              var registry = new Registry {
            { expectedCode, Opcode.Nop, instruction, AddressingMode.Absolute } };

              var fetcher = new Fetcher(model, memory);
              var decoder = new Decoder(registry);
              var executor = new Executor(registry, model, memory);

              loop = new CoreLoop(fetcher, decoder, executor);
        }
开发者ID:joshpeterson,项目名称:mos,代码行数:20,代码来源:CoreLoopTests.cs


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