public void LoadItems()
{
this._items.Clear();
ItemTypeHandler.GetInstance().LoadItemTypes();
DataTable table = this._handler.SelectSQL("SELECT * FROM Item");
if (table != null) {
foreach (DataRow row in table.Rows) {
uint itemID = DatabaseUtil.parseInt(row, "ID");
uint roomID = DatabaseUtil.parseInt(row, "RoomID");
float x = row.Field<float>("X");
float y = row.Field<float>("Y");
ItemType type = ItemTypeHandler.GetInstance().GetByName(row.Field<string>("Type"));
Item item = new Item(itemID, type, roomID);
item.X = x;
item.Y = y;
item.IsLoaded = true;
this._items.Add(item);
}
}
}