Exemple #1
0
        /// <summary>
        /// Loads items
        /// </summary>
        public void LoadItems()
        {
            foreach (DataRow Row in FarmManager.RP_Farms.Rows)
            {
                uint DB_RID = Convert.ToUInt32(Row["room_id"]);

                if (DB_RID == MyRID)
                {
                    int DB_X = Convert.ToInt32(Row["x"]);
                    int DB_Y = Convert.ToInt32(Row["y"]);

                    string DB_TYPE = Convert.ToString(Row["typeobject"]);
                    FarmManager.TypeOfObject ObjectType = FarmManager.GetObjectType(DB_TYPE);

                    uint   ID     = Convert.ToUInt32(FarmItems.Count + 1);
                    object Object = FarmManager.CreateObjectInstance(ID, ObjectType, this, DB_X, DB_Y);

                    if (Object != null)
                    {
                        FarmItems.TryAdd(ID, Object);
                    }
                }
            }
        }