From 8f80df7ce0c1f17a0c70459ec2b8f08d25331752 Mon Sep 17 00:00:00 2001 From: s450026 Date: Wed, 29 Apr 2020 20:56:54 +0200 Subject: [PATCH] Merge AStar --- src/__pycache__/graphics.cpython-37.pyc | Bin 1790 -> 2047 bytes src/__pycache__/matrix.cpython-37.pyc | Bin 1942 -> 1939 bytes src/__pycache__/tile.cpython-37.pyc | Bin 602 -> 910 bytes src/__pycache__/waiter.cpython-37.pyc | Bin 1272 -> 4385 bytes src/graphics.py | 26 ++++++++++++------------ src/matrix.py | 2 +- src/waiter.py | 1 - 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/__pycache__/graphics.cpython-37.pyc b/src/__pycache__/graphics.cpython-37.pyc index c9372dad2b312d6de6d086dc613512adef7bc689..29f67d115bbf74f39bd3bd4cc0aa40853948b20b 100644 GIT binary patch delta 674 zcmZva%}OgV6vuNi)7Y<>R;_pizi$pf-vv8*@}?dAXd@qP5lzKy5E zY*R$z>FTk%5u#JL!!*``o{RTgq60K}W3^EUs8oa6LQR_DYp_Vth1OJlg*z~5OsX-H zY&yQ54{Fucv<7zQ{Po>+g??%@*mS(mWy|M*qH~%K_b9D5Yl_cnp6PMsRZqh23VgTn zh4T_7R)y7Tnr8K5B;^x0W_+3_zbQ?F#RELC(v7H%7o+<1r9$8B_1#wA?eiP_I-8Y; zjN`Jyr>+Se!UP`v8C&pUMxK0HE{3$|1m>|EZT@a{E|+A|R7o3J_BL~Z6R+IJmwne^ zWh@h-86t=Xb&0=(q0oj?G>R^8TivEmqm9Rqpr-JVjC4f13hrP)6z!oLE))lPUzi){ z#;AA1+;ZsEYfSzkY(z>-NEZ%RLXC$xgUP*jiLNU~&g#_l*`QpiWJqPt1L}nCs_+fD ZQ6x@;@LjS4Q~a7NM8>0usL7wn?+?M)qpJV_ delta 338 zcmey*|Bsi?iIj^OW~ZuRl^X^m;xf1Q@DX7 zOA62A07h*VUcV~Y$&HM1j50t{gsVI;Cr7U!FTF|*#N{bTOv*_$MiMAb%q&SQ0t+aE zR7`%r#KxUgl%H1u7E^+WO+LWH$q3`|Gs4wQ=3(YyvnC&5)CsUDVW?ruVr*t~ zVTjeMWvb8s^I5=rsaoa|))b~1rW)pE<{E}9AWM>=hS`Rp&?TIq&?KB8g&~+hliBYj z$eLTMX*v1%MU&l`rZCn`zQbf-=~Kc8G@1!)lwB=Lg$0<;4CZUqvI31|1sca9$xzEy z!cxOr!v^Bjur@PKc4R)ltgWX%nTbVV#XBFw`(+F*Y;0 zFvRNAGF7O7`7B_*L@jd(YYI~eb1!2JLl#pFlO#h8vkgO`OE^QJNjO6aLokCTi(e5V z(6n2uX*v1%MVgFJtR+&y diff --git a/src/__pycache__/tile.cpython-37.pyc b/src/__pycache__/tile.cpython-37.pyc index 465e2fba9924353998479635467a83769e265bb0..54bba7a437e6768c685bf8a12a80eee86ea38f18 100644 GIT binary patch literal 910 zcmYjPy>8nu5GJXg$d26>ZP5m8k*SN9D99WHK~uEo;>BqP4JBxiwiGLpLsCd=cxxV{ zYaXSqz_n9ep;PbZ*zf`T_}!6r-$}er{eG8#ef;zA^E@QvFFG3wfSkiJF9E(1NhH08 z^^0XhvJn{sImEZdfStoK9{?1|s3aMaRI+=L1u~E!?4gVxFLvQ&S*aZKyy1@77qHB4 zfE8U4PFCa!)MiW{N(Meu0%Y|M9}i~CWS)gv7HwI)WqVteK&3)Vy*XdE_-?k9!^yN#F~*Ll@qPs(OTGiHoclSIPxrq1}F7h*I;3ZffhgYiBI-*@jnY zVmFs`IW6oXg%X2~3+-aAT>nTQ)V<>ZUEVk}jDyro@no z=Rzw`?AXSN>Y_0~jTPFiX`xzO8e8Ur(1k`-lPp3x?&zJPiwC0LKokGY((guTlU|Fv zvQ0lLGqcS+y_4x^Y1@2R3;wOPsw$_d&aVVNIX*c~jm}dGk9jm-xPAIA{t*2iyIu~geC_*GK2>4WaqX|_I)L%Yo#-v2e-(7>%!hz delta 386 zcmZusy-EW?5T2RcyPUy03sa}FI14Kai(p~E!r}_GI>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Afr6K4=B5fiSa7Fxd|E1Ub9-- z)_tMT9X+%Ix??&FyL~zAkX{YL&%>xwBBqW_xM~4@Z(U4%qUaSBy-Wp?2}~aMJWrT^ nzAzL7)98%Fve``MDY8>^!kGQfr}kcy@w}w6%P42hsycrF8Br6_ diff --git a/src/graphics.py b/src/graphics.py index 221a58b..736bc70 100644 --- a/src/graphics.py +++ b/src/graphics.py @@ -4,25 +4,25 @@ import pygame class Graphics: def __init__(self): self.image = { - 'floor': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/floor.jpg'), + 'floor': pygame.image.load('./../resources/images/floor.jpg'), # - 'wall': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/wall.png'), + 'wall': pygame.image.load('./../resources/images/wall.png'), # - 'bar': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/table3.png'), - 'bar_floor': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/waiter-up.png'), - 'table': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/table3.png'), - 'waiter_N': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/waiter-up.png'), - 'waiter_S': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/waiter-down.png'), - 'waiter_E': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/waiter-right.png'), - 'waiter_W': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/waiter-left.png'), + 'bar': pygame.image.load('./../resources/images/table3.png'), + 'bar_floor': pygame.image.load('./../resources/images/waiter-up.png'), + 'table': pygame.image.load('./../resources/images/table3.png'), + 'waiter_N': pygame.image.load('./../resources/images/waiter-up.png'), + 'waiter_S': pygame.image.load('./../resources/images/waiter-down.png'), + 'waiter_E': pygame.image.load('./../resources/images/waiter-right.png'), + 'waiter_W': pygame.image.load('./../resources/images/waiter-left.png'), # - 'chair_front': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/chair-front.png'), + 'chair_front': pygame.image.load('./../resources/images/chair-front.png'), # - 'chair_back': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/chair-back.png'), + 'chair_back': pygame.image.load('./../resources/images/chair-back.png'), # - 'chair_left': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/chair-left.png'), + 'chair_left': pygame.image.load('./../resources/images/chair-left.png'), # - 'chair_right': pygame.image.load('/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/images/chair-right.png') + 'chair_right': pygame.image.load('./../resources/images/chair-right.png') } self.block_size = 50 self.height = 15 diff --git a/src/matrix.py b/src/matrix.py index f262245..0d324a6 100644 --- a/src/matrix.py +++ b/src/matrix.py @@ -17,7 +17,7 @@ class Matrix: def set_default_restaurant(self, graphics): lines = [line.rstrip('\n') for line in open( - '/Users/marcindobrowolski/Desktop/Python/Sztuczna_Inteligencja_2020/resources/simulations/simulation_1.txt')] + './../resources/simulations/simulation_1.txt')] symbols = { '_': 'floor', 'W': 'wall', diff --git a/src/waiter.py b/src/waiter.py index 122cdde..5fb43d8 100644 --- a/src/waiter.py +++ b/src/waiter.py @@ -243,6 +243,5 @@ class Waiter(pygame.sprite.Sprite): self.update('L', graphics) graphics.update(self) - def getTotalCost(tile): return tile.totalCost