Example #1
0
        static void Main(string[] args)
        {
            byte[]  fileBytes = File.ReadAllBytes("Clean.ck2");
            Parser  p         = new Parser(fileBytes);
            CK2Game game      = p.Parse();

            Console.ReadLine();
        }
Example #2
0
        private CK2Game PopulateGame(List <Field> fields)
        {
            //at this point, all fields are decoded (string IDs and parsed data). Just need to map them.
            CK2Game game = new CK2Game();

            MapForEach(fields,
                       new Dictionary <string, Action <object> >()
            {
                { "version", val => game.Version = val.ToString() },
                { "date", val => game.CurrentDate = DateTime.Parse((string)val) },
                { "player", val => game.PlayerID = BuildIdentifier(val) },
                { "savelocation", val => game.FilePath = val.ToString() }
            });

            return(new CK2Game());
        }