Esempio n. 1
0
        // create an object from a template
        public clsObject(clsDatabase db, int x,int y, int z, clsTemplate template): base(db)
        {
            this.x = x;
            this.y = y;
            this.z = z;

            this.type = template.type;
            this.name = template.name; // this should be the attribute name not the template name
            this.image = template.image;
            this.weight = template.weight;
            this.stackable = template.stackable;
            this.blocking = template.blocking;
            this.save();

            // loop through template attibutes and use them to create object
            foreach (clsTemplateAttribute ta in template.templateAttributes)
            {
                // copy paste right now but could have random numbers, names etc....
                clsAttribute a = new clsAttribute(_db);
                a.objectId = this.id;
                a.name = ta.name;
                a.value = ta.value;
                a.save();
            }
        }
Esempio n. 2
0
 public clsBase(clsDatabase db, MySqlDataReader dr) {
     this.populate(dr);
 }
Esempio n. 3
0
 public clsBase(clsDatabase db, int id)
 {
     _db = db;
     this.load(id);
 }
Esempio n. 4
0
 public clsBase(clsDatabase db)
 {
     _db = db;
 }
Esempio n. 5
0
 public clsTemplate(clsDatabase db, string name): base(db)
 {
     this.load("SELECT * FROM " + this.tableName + "s WHERE name = '" + name + "'");
 }
Esempio n. 6
0
 public clsTemplate(clsDatabase db, MySqlDataReader dr) : base(db, dr) { }
Esempio n. 7
0
 public clsTemplate(clsDatabase db, int id) : base(db, id) { }
Esempio n. 8
0
 public clsTemplate(clsDatabase db) : base(db) { }
Esempio n. 9
0
 public clsAttribute(clsDatabase db, MySqlDataReader dr) : base(db, dr) { }
Esempio n. 10
0
 public clsAttribute(clsDatabase db, int id) : base(db, id) { }
Esempio n. 11
0
 public clsAttribute(clsDatabase db) : base(db) { }
Esempio n. 12
0
 public clsWorld(string dbConString)
 {
     this.db = new clsDatabase(dbConString);
     this.map = new clsMap(this.db);
 }
Esempio n. 13
0
        private Random r = new Random(); // seed the random

        public clsMap(clsDatabase db) 
        {
            _db = db;
        }
Esempio n. 14
0
 public clsObject(clsDatabase db, MySqlDataReader dr) : base(db, dr) { }
Esempio n. 15
0
 public clsObject(clsDatabase db, int id) : base(db, id) { }
Esempio n. 16
0
 public clsObject(clsDatabase db) : base(db) { }