Skip to content

Commit

Permalink
Merge pull request #4 from AuJUngZ/gameplay
Browse files Browse the repository at this point in the history
Create crude game logic
  • Loading branch information
p-m-a-w authored Feb 27, 2023
2 parents 2fdfd57 + 8f8d0f1 commit 021772b
Show file tree
Hide file tree
Showing 22 changed files with 866 additions and 472 deletions.
17 changes: 17 additions & 0 deletions .idea/artifacts/UPBEAT_jar.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.springtest.api;
package com.example.springtest.websocket_route;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -36,6 +36,12 @@ public ReadyResponse changeReady(@RequestBody ReadyRequest readyRequest) {
readyResponse.setReadyP2(readyRequest.isReadyP2());
return readyResponse;
}

@MessageMapping("/start")
@SendTo("/topic/gameStart")
public boolean gameStart(){
return true;
}
}

@Data
Expand Down
132 changes: 0 additions & 132 deletions src/AST/ASTTest.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/AST/AtomicNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import static AST.ASTException.*;

public class AtomicNode extends ExprNode {
private final int value;
private final long value;
private final String identifier;

public AtomicNode(int value) {
public AtomicNode(long value) {
this.value = value;
this.identifier = null;
}
Expand Down
15 changes: 15 additions & 0 deletions src/Game/Configuration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package Game;

public interface Configuration {
long rows();
long cols();
long initialPlanMinutes();
long initialPlanSeconds();
long initialBudget();
long initialDeposit();
long revisionPlanMinutes();
long revisionPlanSeconds();
long revisionCost();
long maxDeposit();
long interestPercentage();
}
6 changes: 3 additions & 3 deletions src/Game/Direction.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

public enum Direction {
Up,
Down,
UpLeft,
UpRight,
DownRight,
Down,
DownLeft,
DownRight
UpLeft,
}
15 changes: 9 additions & 6 deletions src/Game/Game.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Game;

import Region.Region;
import Region.*;

import java.util.List;
import java.util.Map;
Expand All @@ -19,8 +19,9 @@ public interface Game {
/**
* retrieves deposits from the current region occupied by the city crew.
* @param value collection amount
* @return result of collect, true = success, false = fail
*/
void collect(long value);
boolean collect(long value);

/**
* adds more deposits to the current region occupied by the city crew.
Expand Down Expand Up @@ -52,15 +53,17 @@ public interface Game {
*/
long opponent();

long getCurrentPlayerID();

/**
* submit a plan of current player to the game
* @param constructionPlan a plan
*/
void submitPlan(String constructionPlan);

List<Region> getTerritory();

Region getRegion(int index);
Region getRegion(Point point);

long getBudget();

void endTurn();
Region getCityCrew();
}
Loading

0 comments on commit 021772b

Please sign in to comment.