forked from s452751/AI_PRO
graphserach v0.5
This commit is contained in:
parent
84857e357c
commit
7b59525adc
16
Field.py
16
Field.py
@ -1,13 +1,21 @@
|
||||
class Field:
|
||||
def __init__(self, __horizontal, __vertical, __state):
|
||||
self.horizontal = __horizontal
|
||||
self.vertical = __vertical
|
||||
self.__state = __state
|
||||
def __init__(self, horizontal_index, vertical_index, state):
|
||||
self.__horizontal_index = horizontal_index
|
||||
self.__vertical_index = vertical_index
|
||||
self.__state = state
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self.__state
|
||||
|
||||
@property
|
||||
def horizontal_index(self):
|
||||
return self.__horizontal_index
|
||||
|
||||
@property
|
||||
def vertical_index(self):
|
||||
return self.__vertical_index
|
||||
|
||||
@state.setter
|
||||
def state(self, state):
|
||||
if state == "toPlow" or state == "toWater" or state == "toSeed" or \
|
||||
|
@ -33,4 +33,4 @@ FPS = 10
|
||||
|
||||
#ANIMATION_PART
|
||||
|
||||
ANIMATION_PART = 11
|
||||
ANIMATION_PART = 1
|
@ -33,7 +33,7 @@ def drawInfo(display, tractor, tillageUnit, field, direction):
|
||||
textsurface = myfont.render(text, False, (0, 0, 0))
|
||||
display.blit(textsurface, (50, (DISPLAY_SIZE_VERTICAL - 150)))
|
||||
|
||||
text = f"Current field: {field.horizontal/100, field.vertical/100, field.state} "
|
||||
text = f"Current field: {field.horizontal_index/100, field.vertical_index/100, field.state} "
|
||||
textsurface = myfont.render(text, False, (0, 0, 0))
|
||||
display.blit(textsurface, (50, (DISPLAY_SIZE_VERTICAL - 100)))
|
||||
|
||||
|
3
main.py
3
main.py
@ -3,6 +3,7 @@ import pygame
|
||||
import Board
|
||||
import TractorAction
|
||||
import drawUI
|
||||
from FindPath import graphsearch
|
||||
from Tractor import Tractor
|
||||
from TractorLoad import TillageUnit
|
||||
from animations import animationsOn, animationsOff
|
||||
@ -25,7 +26,7 @@ toolCounter = - 1
|
||||
|
||||
board = Board.generate()
|
||||
|
||||
tractor = Tractor(horizontal_index=-0, vertical_index=0, hitch="nothing", header=False, autodrive=True,
|
||||
tractor = Tractor(horizontal_index=-0, vertical_index=0, hitch="nothing", header=False, autodrive=False,
|
||||
direction='RIGHT')
|
||||
tillageUnit = TillageUnit("Nothing")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user