code cleaning

This commit is contained in:
piowyg 2021-03-27 18:30:45 +01:00
parent f860b1ce45
commit bdddb68e90
3 changed files with 1 additions and 5 deletions

View File

@ -7,7 +7,7 @@ from field import Field
def generate_field () -> List[List[Field]]:
fieldsFactory = FieldsFactory()
fieldsList = fieldsFactory.getFieldsList()
return [choices (fieldsList, weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range (10)]
return [choices(fieldsList, weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)]
class Environment:

View File

@ -1,11 +1,8 @@
from typing import List
from field import Field
class FieldsFactory:
def __init__(self):
pass
def createField(self, number) -> Field:
if number > 3:
return Field(number, True)

View File

@ -29,7 +29,6 @@ class GameUi:
def update(self):
for x in range(10):
for y in range(10):
print(IMAGES[self.env.field[y][x].number])
self.screen.blit(IMAGES[self.env.field[y][x].number], (x * 80, y * 80))
self.screen.blit(self.agent.img, (self.agent.x * 80, self.agent.y * 80))
pg.display.update()