add agent roles

This commit is contained in:
Vadzim Valchkovich 2023-03-30 15:03:19 +02:00
parent 802d5f5b01
commit 263ae113d4
16 changed files with 179 additions and 50 deletions

8
.idea/.gitignore vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (pythonPro)" project-jdk-type="Python SDK" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pythonPro.iml" filepath="$PROJECT_DIR$/.idea/pythonPro.iml" />
</modules>
</component>
</project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

13
Pipfile Normal file
View File

@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pygame = "*"
[dev-packages]
autopep8 = "*"
[requires]
python_version = "3.10"

120
Pipfile.lock generated Normal file
View File

@ -0,0 +1,120 @@
{
"_meta": {
"hash": {
"sha256": "36c5174a38076041f6b328ac1dceec0c2b17bf0b81910348e529d20331ae6e96"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.10"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"pygame": {
"hashes": [
"sha256:033352321cc49d60fdc3c3ae4b3e10ecb6614846fb2eb3453c729aba48a2874d",
"sha256:0a664cd6c50870f6749c389a8844318afc8a2d02f8cb7b05d67930fdf99252bd",
"sha256:0ec8e691407b6c91525b2d7c8386fd6232b97d8f8c33d134ec0c0165b1d52c24",
"sha256:101c57141d705ca1930377c324d2c7acd3099f1b4ac676981bdf5d5b329842c8",
"sha256:17730a2ed1001e5876745702c92906ad31ecedc13825efba56a0cba92e273b7a",
"sha256:1dc89d825e0ccba5ba3605abbd83be1401e0a32de7ab64b9647a6bb1ecb0a4f7",
"sha256:1eda9f30d376d4205e8204e542ab1348dcbb31755c8ba38772e48a3b2f91b2fc",
"sha256:228514c0d034c840b8ee6bf99185df34ac15e6a6a99684b8a3900124417c8d8f",
"sha256:23bd3c3a6d4e8acddee2297d609dbc5953d6ba99b0f0cc5ccc2f567889db3785",
"sha256:246f75f67d2ad4c2dad21b1f35c6092d67c4c0db13b2fa0a42d794e6e2794f47",
"sha256:250b3ec3f90b05ad50cb0070d994a0a1f39fffe8181fc9508b8749884c313431",
"sha256:25c1b1819211aaa0f98264e6b670a496a9975079d5ae2dffd304b0aca6b1aa3c",
"sha256:32bdf1d5d9e0763779d0b915d4617253949a6c118c4c6b5ae1a77cf1df964e4c",
"sha256:35f5a9cc7a9a2ea3d048e418e79f30e1506cb47015939330903026c636761aab",
"sha256:385163fd1ed8809a72be68fddc9c76876c304e8712695aff2ea49adf3831caf9",
"sha256:38642c6cc6477db6ebddd52be39bad0a9e19cf097f83feaaf8e7573b9a9d2405",
"sha256:3d035ba196c258876a87451fa7de65b62c087d7016e51000e8d95bc67c8584f7",
"sha256:3e9535cf1af0c6ca38d94e0b492fc41057d7bf05e9bd64d3ed3e216d336d6d11",
"sha256:3ee86606c6c7f61176ed24b427fa230fe4fc9f552aa555b8db21ddb608b4ce88",
"sha256:43f238229b3a9e5692ba5a31638f1c148257b37a49ef21f03b23b34d7f00b2d9",
"sha256:4b334f6dd6c1412dd4b161a8562b7a422db957f67b7eb93e927606e2dd435882",
"sha256:4db1b103025fd4b451dfa409c0da16d2ff31714ae82bdf45b1434863cd69370b",
"sha256:4f79a3c5e7f24474d6e722d597ee03d2b0d17958c77d4307787147cf339b4ad9",
"sha256:525e11a2b9182ec84d690634016009e382ab8b488593c3f150a0b8aae28aa165",
"sha256:53e9418c457fa549294feee7947bc0b24b048b4eba133f0e757dd2348d15af3b",
"sha256:555234ed6b08242af95406fd3eb43255c3ce8e915e8c751f2d411bd40d574df4",
"sha256:57180b3aabbe17d8017aa724887019943d96ea69810f4315f5c1b7d4f64861f9",
"sha256:59a1e473c627acf369b30bb52fb5f39d1f68f8c204aa857578b72f07a23c952b",
"sha256:619eed2d97f28af9d4cdb217a5517fd6f59b873f2f1d31b4489ed852b9a175c3",
"sha256:653ec5102b9cb13a24e26663a81d7810790e56b88113b90aa5fdca681c01a5b9",
"sha256:6c5d33355dfb66382bcac1fcf3db64ba71bc9e97082db3ae45a7a0d335e73268",
"sha256:6ccde93b51d2393216f98e8f81cf5cc628513d837c89dcf5b588f52031659c09",
"sha256:703d5def9d4dbe9c358f63151bee4a55e328dd7737e692f52522bc44be7c7c8c",
"sha256:740b9f311c693b00d86a89cc6846afc1d1e013b006975eb8be0b18d5481c5b32",
"sha256:774233845099d632de676ad4d4dd08ba27ebce5bfa550b1dc9f6cce145e21c35",
"sha256:788717d0b9a0d0828a763381e1eb6a127ceef815f9a91ff52217ed4b78df62fc",
"sha256:82e5806fd797bd1b27fae705683f6822ae5276ec9cda42e6e21bba61985b763a",
"sha256:8308b21804d137a3b7cafbd020d2159eb5bcc18ffc9c3993b20311069c326a2c",
"sha256:84fad9538012f1d6b298dcf690c4336e0317fe97ac10993b4d847ff547e919dd",
"sha256:858d3968aebaca5015ef0ec82c513114a3c3fe64ce910222cfa852a39f03b135",
"sha256:884b92c9cbf0bfaf8b8dd0f75a746613c55447d307ddd1addf903709b3b9f89f",
"sha256:90931a210325274184860d898df4e87a0972654edbb2a6185afcdce32244dfb6",
"sha256:910678441d02c3b55ac59fcbc4220a824b094407de084734b5d84e0900d6448b",
"sha256:932034e1738873a55c4e2eb83b6e8c03f9a55feaa6a04a7da7b1e0e5a5050b4a",
"sha256:9ccac73a8c913809ba2c1408d750abf14e45666b3c83493370441c52e99222b4",
"sha256:a1d737db18f4c94b620613c6a047a3a1eecc0f36df7d5da4070de575930cc5f0",
"sha256:a5afd712bd7307d034e6940f3025c4b769656fd4cbb38fbdbd6af0f93d6c8386",
"sha256:a5e83bd89da26f8360e02d5de2d2575981b0ebad81ea6d48aba610dabf167b88",
"sha256:a7390815dad55a2db9f8daac6f2c2e593801daea2d674433a72b91ea1caee0d3",
"sha256:a8b315203925724f89a81a741682589ba1c36ec858d98e6accb7501ece9e99a3",
"sha256:ad8fa7a91fa8f2a4fa46366142763675a0a11b7c34b06dfc20b1095d116da820",
"sha256:b507df9ea606a87c29e5028b8de9f35066a15f6a5d7f3e5b47b3719e9403f924",
"sha256:bf236758429d9b9cdadd1fcf40901588818ee440178b932409c40157ab41e902",
"sha256:c2961d44593aaa99580971e4123db00d4ca72fb4b30fa56350b3f6792331a41e",
"sha256:c60be419d7cca1222895dfe9d520628b7346015208382a19fa678356a22664b3",
"sha256:cfff49dbb7fcc2a9a88e3f25fda7f181ee4957fd89df78c47fa64c689d19b8a9",
"sha256:d339f90cc30de4b013670de84abd46de4be602d5c52bbe4e569fa15d17b204ca",
"sha256:d628637d4f0c55613f258b84eef932faf89e683aa842f4fd483a676f44a38606",
"sha256:d949e93fbdaf5b43f69a484639104c07028f93686c8305afb0d8e382fde8ff5d",
"sha256:e13de2947c496fcb600fa4b5cd00a5fa33d4b3af9d13c169a5f79268268de0a8",
"sha256:e323b75abda43345aff5ab2f6b1c017135f937f8a114d7aac8d95a07d200e19f",
"sha256:e3948be800b5f251a0741ec3aab3ca508dfc391095726a69af7064fa4d3e0547",
"sha256:e516bc6bba5455817bbb0038f4c44d1914aac13c7f7954dee9213c9ae28bd9ac",
"sha256:e62607c86e02d29ba5cb00837f73b1dce7b325a1f1f6d93150a0f96fa68da1a1",
"sha256:f2acf958513bd1612960ec68aa5e388262218f7365db59e54e1ee68a55bc544b",
"sha256:f57b1ee40387e43ab5c3cf20437283477b5ef52ead4bb1d9bff254ef9ee70623",
"sha256:fa18acc2d6f0d09575802e1db11845fc0f83f9777cc385c51380125df92f3dc9",
"sha256:fab0457ab07e8abb99de2b83c0a71f98bdf79afb01ff611873e4333fd8649f02"
],
"index": "pypi",
"version": "==2.3.0"
}
},
"develop": {
"autopep8": {
"hashes": [
"sha256:86e9303b5e5c8160872b2f5ef611161b2893e9bfe8ccc7e2f76385947d57a2f1",
"sha256:f9849cdd62108cb739dbcdbfb7fdcc9a30d1b63c4cc3e1c1f893b5360941b61c"
],
"index": "pypi",
"version": "==2.0.2"
},
"pycodestyle": {
"hashes": [
"sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053",
"sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610"
],
"markers": "python_version >= '3.6'",
"version": "==2.10.0"
},
"tomli": {
"hashes": [
"sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
"sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
],
"markers": "python_version < '3.11'",
"version": "==2.0.1"
}
}
}

20
README.MD Normal file
View File

@ -0,0 +1,20 @@
# AUTOMATYCZNY KELNER
> **Authors:** > _Kamil Ryżek_,
> _Aliaksandr Piatrou_,
> _Arseni Zavadski_,
> _Vadzim Valchkovich_
## INSTALATION GUIDE
### Install pipenv
pip install --user pipenv
### Install dependencies
pipenv install -r requirements.txt
## RUN INSTRUCTIONS
pipenv run python main.py

BIN
images/czeka.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
images/kelner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
images/kuchnia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/stół.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/wykonane.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
images/zamowienie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

38
main.py
View File

@ -1,4 +1,5 @@
import pygame import pygame
import random
pygame.init() pygame.init()
@ -15,12 +16,22 @@ squares = []
for i in range(num_squares): for i in range(num_squares):
row = [] row = []
for j in range(num_squares): for j in range(num_squares):
square_rect = pygame.Rect(j * square_size, i * square_size, square_size, square_size) square_rect = pygame.Rect(
j * square_size, i * square_size, square_size, square_size)
row.append(square_rect) row.append(square_rect)
squares.append(row) squares.append(row)
object_rect = pygame.Rect(0, 0, square_size, square_size) roles = ["kuchnia", "stół", "zamowienie", "czeka", "wykonane", "kelner"]
images = {}
roles_rect = {}
for role in roles:
images[role] = pygame.transform.scale(pygame.image.load(
'images/{0}.png'.format(role)), (square_size, square_size))
left = random.randint(0, num_squares - 1) * square_size
top = random.randint(0, num_squares - 1) * square_size
roles_rect[role] = pygame.Rect(left, top, square_size, square_size)
running = True running = True
@ -32,27 +43,26 @@ while running:
elif event.type == pygame.KEYDOWN: elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP: if event.key == pygame.K_UP:
if object_rect.top > 0: if roles_rect["kelner"].top > 0:
object_rect.top -= square_size roles_rect["kelner"].top -= square_size
elif event.key == pygame.K_DOWN: elif event.key == pygame.K_DOWN:
if object_rect.bottom < screen_size[1]: if roles_rect["kelner"].bottom < screen_size[1]:
object_rect.top += square_size roles_rect["kelner"].top += square_size
elif event.key == pygame.K_LEFT: elif event.key == pygame.K_LEFT:
if object_rect.left > 0: if roles_rect["kelner"].left > 0:
object_rect.left -= square_size roles_rect["kelner"].left -= square_size
elif event.key == pygame.K_RIGHT: elif event.key == pygame.K_RIGHT:
if object_rect.right < screen_size[0]: if roles_rect["kelner"].right < screen_size[0]:
object_rect.left += square_size roles_rect["kelner"].left += square_size
screen.fill((255, 255, 255)) screen.fill((255, 255, 255))
for row in squares: for row in squares:
for square_rect in row: for square_rect in row:
pygame.draw.rect(screen, (0, 0, 0), square_rect, 1) pygame.draw.rect(screen, (0, 0, 0), square_rect, 1)
for role in roles:
pygame.draw.rect(screen, (255, 0, 0), object_rect) pygame.draw.rect(screen, (0, 0, 0), roles_rect[role])
screen.blit(images[role], roles_rect[role])
pygame.display.flip() pygame.display.flip()

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
-i https://pypi.org/simple
pygame==2.3.0