Пример #1
0
        protected override void Initialize()
        {
            base.Initialize();
            pers     = new Pers(Content.Load <Texture2D>(@"images/pers"), new Rectangle(30, cont.Height.X2 / 2, 30, 30), 64, 64, new Line(0, 0), new Line(9, 1), 1);
            MainGui  = new GuiContainer(Content.Load <Texture2D>("images/test_gui"), new Container(new Line(200, graphics.PreferredBackBufferWidth - 200), new Line(50, graphics.PreferredBackBufferHeight + 50), 0, 0), 0, 0, Content.Load <SpriteFont>(@"fonts/Main"), "lote", 0, 0);                 //@"fonts/Main"
            SwordGui = new GuiContainer(Content.Load <Texture2D>("images/Item_Sword_of_the_Wyvern"), new Container(new Line(200, graphics.PreferredBackBufferWidth - 200), new Line(50, graphics.PreferredBackBufferHeight + 50), 0, 0), 0, 0, Content.Load <SpriteFont>(@"fonts/Main"), "lote", 0, 0); //@"fonts/Main"
            const string     dbPath       = @"gamedb.db";
            SQLiteConnection dbConnection = new SQLiteConnection(string.Format("Data Source={0};", dbPath));

            if (!File.Exists(dbPath))
            {
                SQLiteConnection.CreateFile(dbPath);
                SQLiteCommand createTablePersinfo  = new SQLiteCommand("CREATE TABLE persinfo(id INTEGER NOT NULL, coordinates TEXT UNIQUE NOT NULL, name TEXT UNIQUE NOT NULL, PRIMARY KEY(id));", dbConnection);
                SQLiteCommand createTablePersitems = new SQLiteCommand("CREATE TABLE persitems(persid INTEGER, itemid INTEGER, slotid INTEGER, stuck INTEGER, strength INTEGER, damage TEXT, typeofdamage TEXT);", dbConnection);

                dbConnection.Open();
                createTablePersinfo.ExecuteNonQuery();
                createTablePersitems.ExecuteNonQuery();
                dbConnection.Close();
            }
            SQLiteCommand selectLustLine = SQL.SelectLustLine("persitems", "itemid", dbConnection);

            dbConnection.Open();
            GlobalIdCreator.GetIDFromSql(selectLustLine);
            dbConnection.Close();
        }
Пример #2
0
 protected override void Initialize()
 {
     base.Initialize();
     pers = new Pers(Content.Load <Texture2D>(@"images/pers"), new Rectangle(30, cont.Height.X2 / 2, 30, 30), 149, 150, new Line(0, 0), new Line(8, 1));
 }