Exemplo n.º 1
0
        void Create()
        {
            InputRecordConfig replayRecord = null;

            if (ReplayShow)
            {
                var replayAsset = Resources.Load <TextAsset>(ReplayPath);
                var lines       = replayAsset.text.Split('\n').Where(l => !string.IsNullOrWhiteSpace(l)).ToArray();
                replayRecord = new InputRecordConfig(lines);
            }
            var screen = new ScreenConfig(8, 8);
            var config = new Configuration(ReplayRecord, replayRecord, null, RandomSeed, FixedFrameTime);
            var root   = new CompositionRoot(
                screen,
                null,
                config,
                () => new ReadUnityInputSystem(new Dictionary <UnityEngine.KeyCode, KeyCode> {
                { UnityEngine.KeyCode.LeftArrow, KeyCode.LeftArrow },
                { UnityEngine.KeyCode.RightArrow, KeyCode.RightArrow },
                { UnityEngine.KeyCode.Space, KeyCode.Spacebar }
            }),
                new Func <ISystem> [0],
                () => new ReadUnityRealTimeSystem(),
                () => new UnityRenderSystem(screen, Renderer));

            (_entities, _systems) = root.Create();
        }
Exemplo n.º 2
0
 public Configuration(bool isReplayRecord, InputRecordConfig savedReplayRecord, string replayPath, int randomSeed, double fixedFrameTiem)
 {
     IsReplayRecord    = isReplayRecord;
     SavedReplayRecord = savedReplayRecord;
     NewReplayPath     = replayPath;
     RandomSeed        = randomSeed;
     FixedFrameTime    = fixedFrameTiem;
 }
Exemplo n.º 3
0
 public FixedInputSystem(InputRecordConfig config)
 {
     _frames2 = new Queue <FrameRecord>(config.Frames);
 }