Skip to content

Commit

Permalink
Merge pull request #107 from siliataider/main
Browse files Browse the repository at this point in the history
rebase
  • Loading branch information
Eliott-rjd authored Jan 18, 2024
2 parents 43389b2 + 268362d commit fec2886
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
1 change: 1 addition & 0 deletions BackSimulation/deploy.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1
1
1
1
22 changes: 18 additions & 4 deletions front/src/assets/panel/CreationPanel.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useDispatch, useSelector} from 'react-redux';
import {React, useState} from 'react';

import { setCursorObject, setBuildingType, switchIsDragging } from "../mouse/mouseSlice";

Expand All @@ -18,6 +19,19 @@ const CreationPanel = (props) => {
const isDragging = useSelector( (state) => state.mouse.isDragging);
const socket = useSelector( (state) => state.socket.socket);

const [counter, setCounter] = useState(1);

const increase = () => {
setCounter(count => count+1)
}

const decrease = () => {
if(counter > 1){
setCounter(count => count-1)
}

}

/**
* Switch the cursore from dragging a building to not or the oposite
*/
Expand Down Expand Up @@ -61,7 +75,7 @@ const CreationPanel = (props) => {
socket.off(socketEvents.saveAndStart)
});

const startMessage = {nAgents : 10}
const startMessage = {nAgents : counter}

console.log(startMessage)

Expand All @@ -73,9 +87,9 @@ const CreationPanel = (props) => {
return(
<>
<h1>Config :</h1>

<button>Agent : 0</button>
<button>+</button>
<button onClick = {decrease}>-</button>
<button>Agents : {counter}</button>
<button onClick = {increase}>+</button>
<br></br>


Expand Down
18 changes: 12 additions & 6 deletions launcher.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/bin/bash

# Install python requirements
pip install -r backAgent/requirements.txt

# Start Nginx reverse proxy container
cp ./nginx.conf /tmp/
sudo docker run --name citymanager-nginx-container --network host -v /tmp/nginx.conf:/etc/nginx/nginx.conf:ro --rm nginx &

# To kill all dockers : docker stop $(docker ps -a -q)
# Install python requirements
cd backAgent
pip install -r requirements.txt
python main.py &

# Start the java backend
cd ../BackSimulation
mvn clean package
java -jar target/BackSimulation-0.0.1-SNAPSHOT.jar &

# Start the react front-end
cd front
cd ../front
npm install
npm run dev &

echo "READY !"
# Done
echo "READY !"
6 changes: 6 additions & 0 deletions package-lock.json

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

0 comments on commit fec2886

Please sign in to comment.