本文整理汇总了C#中ICpu类的典型用法代码示例。如果您正苦于以下问题:C# ICpu类的具体用法?C# ICpu怎么用?C# ICpu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICpu类属于命名空间,在下文中一共展示了ICpu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MotherBoard
public MotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard)
{
this.ram = ram;
this.cpu = cpu;
this.hardDrive = hardDrive;
this.videoCard = videoCard;
}
示例2: Computer
public Computer(ICpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCardBase videoCard)
{
this.Cpu = cpu;
this.Ram = ram;
this.HardDrives = hardDrives;
this.VideoCard = videoCard;
}
示例3: Server
public Server(ICpu cpu, IRamMemory ram, IEnumerable<IHardDrive> hardDrives)
{
this.Cpu = cpu;
this.Ram = ram;
this.HardDrives = hardDrives;
this.VideoCard = this.defaultVideoCard;
}
示例4: Computer
public Computer(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives)
{
this.cpu = cpu;
this.ram = ram;
this.videoCard = videoCard;
this.hardDrives = hardDrives;
}
示例5: GetPc
public IPc GetPc(
ICpu cpu,
IEnumerable<IHardDrive> hardDrives,
IMotherboard motherboard)
{
return new Pc(cpu, hardDrives, motherboard);
}
示例6: GetServer
public IServer GetServer(
ICpu cpu,
IEnumerable<IHardDrive> hardDrives,
IMotherboard motherboard)
{
return new Server(cpu, hardDrives, motherboard);
}
示例7: ReverseStackArgs
/// <summary>
/// Take the topmost arguments down to the ARG_MARKER_STRING, pop them off, and then
/// put them back again in reversed order so a function can read them in normal order.
/// Note that if this is an indirect call, it will also consume the thing just under
/// the ARG_MARKER, since that's expected to be the delegate or KOSDelegate that we already
/// read and pulled the needed information from.
/// <param name="cpu">the cpu we are running on, fur stack manipulation purposes</param>
/// <param name="direct">need to know if this was a direct or indirect call. If indirect,
/// then that means it also needs to consume the indirect reference off the stack just under
/// the args</param>
/// </summary>
public static void ReverseStackArgs(ICpu cpu, bool direct)
{
List<object> args = new List<object>();
object arg = cpu.PopValue();
while (cpu.GetStackSize() > 0 && arg.GetType() != ArgMarkerType)
{
args.Add(arg);
// It's important to dereference with PopValue, not using PopStack, because the function
// being called might not even be able to see the variable in scope anyway.
// In other words, if calling a function like so:
// declare foo to 3.
// myfunc(foo).
// The code inside myfunc needs to see that as being identical to just saying:
// myfunc(3).
// It has to be unaware of the fact that the name of the argument was 'foo'. It just needs to
// see the contents that were inside foo.
arg = cpu.PopValue();
}
if (! direct)
cpu.PopStack(); // throw away the delegate or KOSDelegate info - we already snarfed it by now.
// Push the arg marker back on again.
cpu.PushStack(new KOSArgMarkerType());
// Push the arguments back on again, which will invert their order:
foreach (object item in args)
cpu.PushStack(item);
}
示例8: Server
public Server(
ICpu cpu,
IEnumerable<IHardDrive> hardDrives,
IMotherboard motherboard)
: base(cpu, hardDrives, motherboard)
{
}
示例9: Computer
public Computer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage)
{
Storage = storage;
Gpu = gpu;
Ram = ram;
Cpu = cpu;
}
示例10: Computer
public Computer(ComputerType type, ICpu cpu, Ram ram, IEnumerable<HardDrive> hardDrives, IVideoCard videoCard)
{
this.Cpu = cpu;
this.Ram = ram;
this.HardDrives = hardDrives;
this.VideoCard = videoCard;
this.Type = type;
}
示例11: GetLaptop
public ILaptop GetLaptop(
ICpu cpu,
IEnumerable<IHardDrive> hardDrives,
IMotherboard motherboard,
ILaptopBattery battery)
{
return new Laptop(cpu, hardDrives, motherboard, battery);
}
示例12: Laptop
public Laptop(
ICpu cpu,
IEnumerable<IHardDrive> hardDrives,
IMotherboard motherboard,
ILaptopBattery battery)
: base(cpu, hardDrives, motherboard)
{
this.Battery = battery;
}
示例13: Computer
public Computer(
ICpu cpu,
IEnumerable<IHardDrive> hardDrives,
IMotherboard motherboard)
{
this.Cpu = cpu;
this.HardDrives = hardDrives;
this.Motherboard = motherboard;
}
示例14: Console
public Console(ICpu cpu, IMmu mmu, IGpu gpu, ITimer timer, IController controller)
{
Cpu = cpu;
Mmu = mmu;
Gpu = gpu;
Timer = timer;
Controller = controller;
_emitFrames = true;
_breakpoints = new HashSet<uint>();
}
示例15: UserDelegate
/// <summary>
/// Make a new UserDelegate given the current state of the CPU and its stack, and
/// the entry point location of the function to call.
/// </summary>
/// <param name="cpu">the CPU on which this program is running.</param>
/// <param name="context">The IProgramContext in which the entryPoint is stored. Entry point 27 in the interpreter is not the same as entrypoint 27 in program context.</param>
/// <param name="entryPoint">instruction address where OpcodeCall should jump to to call the function.</param>
/// <param name="useClosure">If true, then a snapshot of the current scoping stack, and thus a persistent ref to its variables,
/// will be kept in the delegate so it can be called later as a callback with closure. Set to false if the
/// function is only getting called instantly using whatever the scope is at the time of the call.</param>
public UserDelegate(ICpu cpu, IProgramContext context, int entryPoint, bool useClosure)
{
this.cpu = cpu;
ProgContext = context;
EntryPoint = entryPoint;
if (useClosure)
CaptureClosure();
else
Closure = new List<VariableScope>(); // make sure it exists as an empty list so we don't have to have 'if null' checks everwywhere.
}