Exemple #1
0
        GridRules LoadRules(string datafile)
        {
            var rules = new GridRules();

            FileIterator.ForEachLine <string>(datafile, line =>
            {
                ParseRule(rules, line);
            });

            return(rules);
        }
Exemple #2
0
        void ParseRule(GridRules rules, string rule)
        {
            var fromTo    = rule.Replace(" => ", "|").Split('|');
            var rotations = CreateRotations(fromTo[0]);
            var writer    = CreateWriter(fromTo[1]);

            foreach (var rotation in rotations)
            {
                if (rules.ContainsKey(rotation))
                {
                    Oh.Bugger();
                }
                rules[rotation] = writer;
            }
        }
Exemple #3
0
 private void GridRules_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     GridRules.Columns["Id"].Visible = false;
     GridRules.ClearSelection();
 }
Exemple #4
0
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 void Awake()
 {
     Instance = this;
 }