Esempio n. 1
0
        protected override void OnActivated(EventArgs e)
        {
            base.OnActivated(e);
            var data = new CGOutputProcessor("DataStates.txt");

            _states = data.States.Select(s => (new SerialReader(s)).Read <TheOutState>()).ToList();

            foreach (var state in _states)
            {
                RestoreField(state);
            }

            _states[0].Field.InitCellConnections();
            foreach (var s in _states.Skip(1))
            {
                s.Field.CellConnections = _states[0].Field.CellConnections;
            }

            TickSlider.Maximum       = _states.Count - 1;
            TickSlider.ValueChanged += (sender, args) =>
            {
                var state = _states[(int)TickSlider.Value];

                GenerateForTick(state);
            };
            GenerationSlider.Maximum       = 0;
            GenerationSlider.ValueChanged += (o, args) => DrawGeneration();
        }
Esempio n. 2
0
        public static void Test()
        {
            var data = new CGOutputProcessor("Data.txt");

            foreach (var state in data.States)
            {
                var r  = new SerialReader(state);
                var gf = r.Read <GameField>();
                Console.WriteLine();
            }

            var res = data.States.Select(s => (new SerialReader(s)).Read <GameField>()).ToList();


            Console.WriteLine();
        }
Esempio n. 3
0
        private void PrepareInput()
        {
            var data = new CGOutputProcessor("Data.txt");

            _maps = data.States.Select(s => (new SerialReader(s)).Read <TheOut>()).ToList();
        }