Hopefully getting the database to init and reset itself (in testground.rb, need to make that more of a active_rpg.rb thing...
This commit is contained in:
parent
3579f47eda
commit
d81c397629
7 changed files with 35 additions and 25 deletions
|
|
@ -9,14 +9,13 @@ class ActiveRpg
|
|||
@sc = nil
|
||||
@ef = nil
|
||||
|
||||
def initialize(grid_size = 10, db="testdb")
|
||||
def initialize(grid_size = 10, db="defaultdb")
|
||||
@sc = SQLiteConnect.new(db)
|
||||
@ef = EntityFactory.new(@sc)
|
||||
@grid = RpgGrid.new(@sc, grid_size)
|
||||
end
|
||||
|
||||
# this should only really ever be needed in a simulation run to clear out the DB and reset the indexes
|
||||
def get_sc()
|
||||
def get_sql_connect()
|
||||
return @sc
|
||||
end
|
||||
|
||||
|
|
@ -48,7 +47,7 @@ class ActiveRpg
|
|||
end
|
||||
|
||||
def find_player(player_name)
|
||||
found_player = @sc.execute("
|
||||
found_player = @sc.query("
|
||||
SELECT * FROM players WHERE player_name = #{player_name}
|
||||
").first
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue