-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocation.cs
45 lines (36 loc) · 1.13 KB
/
Location.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SQLite;
namespace DreamQEngine
{
public class Location
{
//The background image for this location
protected string mImgPath;
//This location's name
protected string mName;
public Location(int locationRef, SQLiteConnection conn)
{
SQLiteDataReader reader = new SQLiteCommand("Select * From Locations WHERE id = " + locationRef + ";", conn).ExecuteReader();
DataTable locationtable = new DataTable();
locationtable.Load(reader);
DataView locationView = new DataView(locationtable);
if (locationView.Count > 0)
{
mImgPath = locationView[0]["backgroundImage"].ToString();
mName = locationView[0]["name"].ToString();
}
}
public string imgPath {
set { mImgPath = value; }
get { return mImgPath; }
}
public string name
{
set { mName = value; }
get { return mName; }
}
}
}