Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L8 #459

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

L8 #459

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "libs/cppzmq"]
path = libs/cppzmq
url = https://github.com/zeromq/cppzmq
[submodule "libs/libzmq"]
path = libs/libzmq
url = https://github.com/zeromq/libzmq
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/pdgm21.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

168 changes: 168 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.16)

set(PROJECT_NAME "List 8")
set(CMAKE_CXX_FLAGS "-g -Wall -Werror -pthread")
set(CMAKE_CXX_STANDARD 20)

project(${PROJECT_NAME}
DESCRIPTION "This project implements Kalaha game"
VERSION 1.0
LANGUAGES CXX)

set(INCLUDES_DIR "${PROJECT_SOURCE_DIR}/inc/")
set(INCLUDES_GAMELOGIC_DIR "${INCLUDES_DIR}/GameLogic")

add_subdirectory(src)

set(MAIN_APP_SOURCES main.cpp inc/GameLogic/GameSystems/IRemoteSession.hpp inc/GameLogic/GameSystems/ILocalHandler.hpp inc/GameLogic/GameSystems/IRemoteHandler.hpp inc/GameLogic/GameSystems/ILocalSession.hpp inc/GameLogic/GameSystems/ISession.hpp inc/GameLogic/GameSystems/IHandler.hpp inc/GameLogic/GameSystems/GameSessionSate.hpp inc/GameLogic/GameSystems/PlayerMoveState.hpp inc/GameLogic/GameSystems/PlayerMove.hpp)
set(MAIN_APP APP)

add_executable(${MAIN_APP} ${MAIN_APP_SOURCES})

target_include_directories(${MAIN_APP} PRIVATE ${INCLUDES_GAMELOGIC_DIR}/GameSystems)

target_link_libraries(${MAIN_APP} PRIVATE LIB_GAMESYSTEMS)

#find cppzmq wrapper, installed by make of cppzmq
find_package(cppzmq)
target_link_libraries(${MAIN_APP} PRIVATE cppzmq)
1 change: 1 addition & 0 deletions Python/.flaskenv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FLASK_APP=Kalaha.py
8 changes: 8 additions & 0 deletions Python/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Python/.idea/Python.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Python/.idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Python/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Python/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Python/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Python/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions Python/Kalaha.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import base64
import time
import zmq

server_protocol = "tcp"
server_ip = '127.0.0.1'
server_port = '5556'
server_address = f'{server_protocol}://{server_ip}:{server_port}'
client_msg = 'Message from client'


def zeromsg_example() -> None:
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(server_address)
print(f"Connected to the server {server_address}!")

# send/Request
start = time.time()
socket.send_string(client_msg)

# Get the reply.
message = socket.recv_string()
print(f'Received reply from {server_address} = "{message}"')

socket.close()

from app import app
def flask_example():
app.run(debug=True)



if __name__ == '__main__':
# zeromsg_example()
flask_example()


# See PyCharm help at https://www.jetbrains.com/help/pycharm/
Empty file added Python/Messages.txt
Empty file.
5 changes: 5 additions & 0 deletions Python/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from flask import Flask

app = Flask(__name__)

from app import routes
Binary file added Python/app/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file added Python/app/__pycache__/routes.cpython-310.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions Python/app/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from app import app


@app.route('/')
@app.route('/index')
def index():
user = {'username': "Jakub"}
return '''
<html>
<head>
<title>Home Page - Kalaha</title>
</head>
<body>
<h1>Hello, ''' + user['username'] + '''!</h1>
</body>
</html>'''
5 changes: 5 additions & 0 deletions Python/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


class Client:
def __init__(self):
pass
5 changes: 5 additions & 0 deletions Python/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


class Server:
def __init__(self):
pass
Empty file added README.md
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading