Пример #1
0
 /// <summary>
 /// Prevents a default instance of the <see cref="EngineCore" /> class from being created
 /// </summary>
 private EngineCore()
 {
     this.Processes = new ProcessAdapter();
     this.OperatingSystemAdapter = OperatingSystemAdapterFactory.GetOperatingSystemAdapter();
     this.Architecture           = ArchitectureFactory.GetArchitecture();
     this.Input = new InputManager();
 }
Пример #2
0
 public void Initialize()
 {
     m_Bank   = new MemoryBank(64);
     m_Reader = new OperationDTOReader(
         ArchitectureFactory.CreateArchitecture(new MemoryBankService(new List <IMemoryBank> {
         m_Bank
     })));
 }
Пример #3
0
 public void Initialize()
 {
     m_BankService = new MemoryBankService(new List <IMemoryBank>()
     {
         new MemoryBank(32)
     });
     m_Reader = new OperationReader(ArchitectureFactory.CreateArchitecture(m_BankService), _CreateReader());
 }
Пример #4
0
        /// <summary>
        /// Prevents a default instance of the <see cref="EngineCore" /> class from being created.
        /// </summary>
        private EngineCore()
        {
            this.Processes     = ProcessAdapterFactory.GetProcessAdapter();
            this.VirtualMemory = VirtualMemoryAdapterFactory.GetVirtualMemoryAdapter();
            this.Network       = new Network();
            this.Architecture  = ArchitectureFactory.GetArchitecture();
            this.Input         = new InputManager();

            this.StartBackgroundServices();
        }
Пример #5
0
    // Use this for initialization
    public static IEnumerator Generate(System.Random rand)
    {
        ArchitectureFactory architectureFactory = new ArchitectureFactory();

        Architecture.direction dir;

        foreach (Room room in Map.roomObjs)
        {
            if (room.roomType == roomType.common)
            {
                yield return(new WaitForSecondsRealtime(0.25f));

                for (int i = 0; i < 3; i++)
                {
                    ArchitectureType type = (ArchitectureType)rand.Next(0, 4);

                    Architecture arch = architectureFactory.CreateArchitecture(type);
                    arch.randomGen = rand;

                    dir = arch.GetRandom();

                    arch.Create(room, dir);
                }

                //int createPool = Random.Range(0, 6);//20%

                //if (createPool == 0)
                //{
                //    Pools pool = ScriptableObject.CreateInstance("Pools") as Pools;

                //    dir = pool.GetRandom();

                //    pool.Create(room, dir);
                //}

                int createCuts = rand.Next(0, 2);//50%
                if (createCuts == 0)
                {
                    Cuts cuts = new Cuts();
                    cuts.randomGen = rand;

                    dir = cuts.GetRandom();

                    cuts.Create(room, dir);
                }
            }
        }
        yield return(0);
    }
Пример #6
0
        /// <summary>
        /// Prevents a default instance of the <see cref="EngineCore" /> class from being created.
        /// </summary>
        private EngineCore()
        {
            this.Processes     = ProcessAdapterFactory.GetProcessAdapter();
            this.VirtualMemory = VirtualMemoryAdapterFactory.GetVirtualMemoryAdapter();
            this.Debugger      = DebuggerFactory.GetDebugger();
            this.Graphics      = new GraphicsAdapter();
            this.Network       = new Network();
            this.Architecture  = ArchitectureFactory.GetArchitecture();
            this.Input         = new InputManager();

            if (this.Architecture.HasVectorSupport())
            {
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Hardware acceleration enabled");
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Vector size: " + System.Numerics.Vector <Byte> .Count);
            }

            this.StartBackgroundServices();
        }
Пример #7
0
 private IOperationReader _CreateReader()
 {
     return(new OperationReader(ArchitectureFactory.CreateArchitecture(m_BankService),
                                new OperationDTOReader(ArchitectureFactory.CreateArchitecture(m_BankService))));
 }