Exemplo n.º 1
0
        public static int New(string prefix)
        {
            string filename = prefix + "_AI.bin";

            BinaryHelper<packAI> binaryHelper = new BinaryHelper<packAI>();

            if (!binaryHelper.FileExists(filename) )
            {
               binaryHelper.SaveObject(new packAI()
               {
                   Number = 0
               }, filename);
            }
            packAI pack = binaryHelper.LoadObject(filename);

            pack.Number++;
            binaryHelper.SaveObject(pack,filename);
            return pack.Number;

        }