本文整理汇总了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);
}
示例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;
}
示例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));
}
示例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);
}