public DBMigrations(SQLGlue db)
        {
            this.db = db;

            tables.Add(new TableDefinition("version", new string[] { "latest integer primary key" }));

            tables.Add(new TableDefinition("farmville_crops", new string[] { "id integer primary key autoincrement", "name string", "type string", "cost integer", "sells integer", "profit integer", "xp integer", "harvest integer", "wilts integer" }));
            migrations.Add(new Migration("create", "farmville_crops", getTableDefinition("farmville_crops").columns, null));

            string[] farmville_crops_fields = new string[] { "name", "type", "cost", "sells", "profit", "xp", "harvest", "wilts" };

            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Strawberries",	"fruit",	    10,	    35,	    25,     1,	    240,	480 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Eggplant",		"fruit",	    25,	    88,	    63,	    2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Wheat",		    "grains",	    35,	    115,	80,	    2,	    4320,	8640 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Soybeans",		"vegetables",	15,	    63,	    48,	    2,	    1440,	2880 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Squash",		    "vegetables",	40,	    121,	81,	    2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Pumpkin",		    "vegetables",	30,	    68,	    38,	    1,	    480,	960 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Artichokes",		"vegetables",	70,	    204,	134,	2,	    5760,	10920 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Rice",		    "grains",	    45,	    96,	    51,	    1,	    720,	1440 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Raspberries",		"fruit",	    20,	    46,	    26,	    0,	    120,	240 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Daffodils",		"flowers",	    60,	    135,	75,	    2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Cotton",		    "other",	    75,	    207,	132,	2,	    4320,	8640 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Cranberries",		"fruit",	    55,	    98,	    43,	    1,	    600,	1200 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Bell Peppers",	"fruit",	    75,	    198,	123,	2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Peppers",		    "fruit",	    70,	    162,	92,	    2,	    1440,	2880 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Morning Glory",	"flowers",	    60,	    123,	63,	    1,	    720,	1440 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Aloe vera",		"other",	    50,	    85,	    35,	    1,	    360,	720 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Pineapples",		"fruit",	    95,	    242,	147,	2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Red Tulips",		"flowers",	    75,	    159,	84,	    2,	    1440,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Pattypan Squash",	"vegetables",	65,	    160,	95,	    1,	    960,	1920 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Blueberries",		"fruit",	    50,	    91,	    41,	    1,	    240,	480 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Watermelon",		"fruit",	    130,	348,	218,	2,	    5760,	10920 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Grapes",		    "fruit",	    85,	    270,	185,	2,	    1440,	2880 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Tomatoes",		"fruit",	    100,	173,	73,	    1,	    480,	960 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Pink Roses",		"flowers",	    120,	254,	134,	2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Potatoes",		"vegetables",	135,	345,	210,	2,	    4320,	8640 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Carrots",		    "vegetables",	110,	200,	90,	    1,	    720,	1440 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Coffee",		    "other",	    120,	243,	123,	1,	    960,	1920 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Corn",		    "grains",	    150,	380,	230,	2,	    4320,	8640 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Sunflowers",		"flowers",	    135,	315,	180,	2,	    1440,	2880 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Ghost Chilli",	"fruit",	    80,	    136,	56, 	1,	    360,	720 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Cabbage",		    "vegetables",	140,	388,	248,	2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Green Tea",		"other",	    105,	191,	86,	    1,	    600,	1200 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Black Berries",	"fruit",	    75,	    117,	42,	    1,	    240,	480 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Red Wheat",		"grains",	    180,	449,	269,	2,	    4320,	8640 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Lavender",		"flowers",	    160,	384,	224,	2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Sugar Cane",		"other",	    165,	239,	74,	    1,	    480,	960 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Peas",		    "vegetables",	190,	381,	191,	3,	    1440,	2880 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Yellow Melon",	"fruit",	    205,	528,	323,	2,	    5760,	10920 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Onion",		    "vegetables",	170,	275,	105,	1,	    720,	1440 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Broccoli",		"vegetables",	200,	473,	273,	2,	    2880,	5760 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Lillies",		    "flowers",	    195,	369,	174,	2,	    1440,	2880 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Acorn Squash",	"vegetables",	175,	258,	83,	    1,	    600,	1200 }));
            migrations.Add(new Migration("insert", "farmville_crops", farmville_crops_fields, new object[] { "Asparagus",		"vegetables",	220,	357,	137,	2,	    960,	1920 }));

            tables.Add(new TableDefinition("farmville_plots", new string[] { "id integer primary key autoincrement", "crop_name string", "quantity integer", "cost integer", "profit integer", "xp integer", "harvest datetime", "wilts datetime" }));
            migrations.Add(new Migration("create", "farmville_plots", getTableDefinition("farmville_plots").columns, null));
        }
Beispiel #2
0
        public MainForm()
        {
            InitializeComponent();

            db = new SQLGlue();
            db.openDatabase(DB_FILE);
            checkDatabase();
            getDBVersion();

            welcomeSlide = new Slides.WelcomeSlide(this);
            farmvilleSlide = new Slides.FarmvilleSlide(this);
            slideContainer.AddSlide(welcomeSlide);
            slideContainer.AddSlide(farmvilleSlide);
            slideContainer.Selected = welcomeSlide;
        }