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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie-edge"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> | |
<style> | |
#map{ | |
height: 400px; |
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
from dialogue_menus import * | |
from rooms import * | |
courtyard = Room( | |
'This is a courtyard', | |
{'North':'Entrance'}, | |
['item1', 'item2'], | |
['monster1', 'monster2'] | |
) |
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
from dialogue_menus import * | |
from rooms import * | |
courtyard = Room( | |
'This is a courtyard', | |
{'North':'Entrance'}, | |
['item1', 'item2'], | |
['monster1', 'monster2'] | |
) |
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
import json | |
with open('roomsjson.txt', encoding='utf-8') as data_file: | |
data = json.loads(data_file.read()) | |
class Room: | |
def __init__(self, description, directions, items, monsters): | |
self.description = description | |
self.directions = directions | |
self.items = items |
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
import sys, logging | |
class Room: | |
def __init__(self, description, directions, items, monsters): | |
self.description = description | |
self.directions = directions | |
self.items = items | |
self.monsters = monsters | |
def __repr__(self): |
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
class Rooms: | |
def __init__(self, description, directions, items, monsters): | |
self.description = description | |
self.directions = directions | |
self.items = items | |
self.monsters = monsters | |
def interact(self): | |
for k, v in enumerate(self.directions.keys(), 1): | |
print(k, v) |
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
def test(self): | |
try: | |
for row in range(self.orders_table.rowCount()): | |
for col in range(self.orders_table.columnCount()): | |
value = self.orders_table.item(row, col).text() | |
self.orders_table_list.append(value) | |
except Exception as e: | |
print(e) | |
Message in console: 'NoneType' object has no attribute 'text' |
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
def test(self): | |
a_list = [] | |
for row in range(self.orders_table.rowCount()): | |
for col in range(self.orders_table.columnCount()): | |
if self.orders_table.item(row, col) == None: | |
value = '0' | |
else: | |
value = self.orders_table.item(row, col).text() | |
a_list.append(value) | |
print(a_list) |
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
def test(self): | |
for row in range(self.orders_table.rowCount()): | |
for col in range(self.orders_table.columnCount()): | |
value = self.orders_table.item(row, col) | |
value = str(value.text()) | |
self.orders_table_list.append(value) | |
print(self.orders_table_list) |
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
from monster_classes import Goblin, Troll | |
class Room: | |
def __init__(self, name, directions, items, monster, description=None): | |
self.name = name | |
self.directions = directions | |
self.items = items | |
self.monsters = monster | |
self.description = description | |
NewerOlder