rename field to tile
This commit is contained in:
parent
d6caa9aad9
commit
e84a93580e
@ -1,16 +1,16 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
from random import choices
|
from random import choices
|
||||||
|
|
||||||
from field import Field
|
from tile import Tile
|
||||||
from fieldsFactory import FieldsFactory
|
from tilesFactory import TilesFactory
|
||||||
|
|
||||||
|
|
||||||
def generate_field () -> List[List[Field]]:
|
def generate_field() -> List[List[Tile]]:
|
||||||
fields_factory = FieldsFactory()
|
tiles_factory = TilesFactory()
|
||||||
fields_list = fields_factory.get_fields_list()
|
tiles_list = tiles_factory.get_tiles_list()
|
||||||
return [choices(fields_list, weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)]
|
return [choices(tiles_list, weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)]
|
||||||
|
|
||||||
|
|
||||||
class Environment:
|
class Environment:
|
||||||
def __init__(self, field: List[List[Field]] = None):
|
def __init__(self, field: List[List[Tile]] = None):
|
||||||
self.field = field if field else generate_field()
|
self.field = field if field else generate_field()
|
||||||
|
Loading…
Reference in New Issue
Block a user