-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from CKjolhede/finalizesetup
Finalizesetup
- Loading branch information
Showing
6 changed files
with
179 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from models.__init__ import CONN, CURSOR | ||
from models.game import Game | ||
from models.space import Space | ||
from models.player import Player | ||
from models.game_space import Game_space | ||
from sqlite3 import * | ||
|
||
def migrate(): | ||
Game.drop_table() | ||
Space.drop_table() | ||
Game_space.drop_table() | ||
Player.drop_table() | ||
print("Tables have been dropped") | ||
Game_space.create_table() | ||
Game.create_table() | ||
Space.create_table() | ||
Player.create_table() | ||
print("Tables have been created") | ||
|
||
def seed_spaces(): | ||
spaces = [('GO', 0, 0, 1, "Game", 1), | ||
('unowned', 60, 30, 2, "Pink", 0), | ||
('unowned', 80, 40, 3, "Pink", 0), | ||
('unowned', 0, 100, 4, "Player", 0), | ||
('unowned', 100, 50, 5, "Lt Blue", 0), | ||
('unowned', 120, 60, 6, "Lt Blue", 0), | ||
('CASINO', 0, 0, 0, "Game", 1), | ||
('unowned', 140, 70, 8, "Purple", 0), | ||
('unowned', 160, 80, 9, "Purple", 0), | ||
('unowned', 0, 100, 10, "Player", 0), | ||
('unowned', 180, 90, 11, "Orange", 0), | ||
('unowned', 200, 100, 12, "Orange", 0), | ||
("Free Spasce", 0, 0, 13, "Game", 1), | ||
("unowned", 220, 110, 14, "Red", 0), | ||
("unowned", 240, 120, 15, "Red", 0), | ||
("unowned", 0, 100, 16, "Player", 0), | ||
('unowned', 260, 130, 17, "Yellow", 0), | ||
("unowned", 280, 140, 18, "Yellow", 0), | ||
("Pay HOA", 0, 200, 19, "Game", 1), | ||
("unowned", 300, 150, 20, "Green", 0), | ||
("unowned", 320, 160, 21, "Green", 0), | ||
("unowned", 0, 100, 22, "Player", 0), | ||
("unowned", 360, 130, 23, "Blue", 0), | ||
("unowned", 400, 200, 24, "Blue", 0)] | ||
for space in spaces: | ||
Space.create(*space) | ||
print("Spaces have successfully seeded") | ||
|
||
if __name__ == "__main__": | ||
migrate() | ||
seed_spaces() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import sqlite3 | ||
|
||
CONN = sqlite3.connect('./lib/monopolython.db') | ||
CONN = sqlite3.connect('./monopolython.db') | ||
CURSOR = CONN.cursor() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# lib/helper.py | ||
import time | ||
from sqlite3 import * | ||
import os | ||
import random | ||
import ipdb | ||
from models.player import Player | ||
from models.game_space import Game_space | ||
from models.game import Game | ||
from models.__init__ import CONN, CURSOR | ||
|
||
def base(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters