Git Product home page Git Product logo

catan-heroes's People

Contributors

abvg9 avatar notaphplover avatar

Watchers

 avatar  avatar

Forkers

abvg9

catan-heroes's Issues

Implement a player agent

The domain layer needs a player agent. A player agent interface must be implemented.

  • Any player agent must have a void method handle able to handle any IComand object.

Add game engine request log

A game viewer is about to be implemented.

It demands a way to recreate a game.
In addition, some actions cannot be performed twice in a turn.

For now, the game log features must be declared as an interface IGameLog

  • A game log must return the number of turns played.
  • A game log must return the production number at a certain turn.
  • A game log must return the collection of actions performed at a certain turn.

CatanGameEngine must receive an IGameLog instance to store

An implementation of the interface must be added.

It's recommended to use a TreeMap of turn numbers to ArrayList of IRequest

Important: this is a first approach. AI features could demand a develop iteration.

Improve Readme

Our README.md sucks :(

  • Add build status Java CI.
  • Add maven package info (Maybe maven-badges is a good enough tool).
  • Add a brief description of the project.
  • Add build notes.
  • Add test notes.

Implement a build initial settlement request

A Build initial settlement request must be implemented.

  • A game engine must process this request only if the turn is started.
  • A game engine must process this request only if the active player is the request sender.
  • A game engine must process this request only if the game state is GameState.FOUNDATION.
  • A game engine must consider an error to process more than one valid request of this type at the same turn.
  • A game engine must build the settlement without substracting resources.

Refactor Build element tests

Agnostic request were implemented, but the test classes associated require a refactor.

  • Tests for agnostic build element requests must be added.
  • Tests for build element requests must be changed to test only those classes.

Send commands as an after success action

Catan game handlers need manage the log and request notifications to players.

Any command sent before this management process will not contain the last request handled.

This bug can be fixed sending the command as a post success action.

  • Refactor handlers to send commands as a post success action.
  • Add a test to detect this case.

Edit: handlers are correctly implemented, so this issue consist in adding the test

Simplify CatanGame

There is a game and a game engine. It does not make sense that hierachy. A single class and a single interface must remain.

Consider adopting CQRS

  • Catan game engine has a native and ugly implementation of command handlers.
  • The editable board reindex its production map when an structure is built.
  • The point calculator could be faster with a cache strategy based on adjusting points when a board element is built or upgraded.

All this facts demands a CQRS pattern.

Consider using Axon messaging.

Implement initial build element requests

Our clients demands initial build element request in order to start a game.

  • An initial structure build request must be implemented.
  • An initial connection build request must be implemented.

Use gradle

Gradle is a must in order to perform CI, automatic code style and other stuff

Add an ICommand interface

The game needs a tool to send commands to the players.

  • Implement a ICommand interface and an abstract command class.
  • A command must contain a command type: an enum to be implemented.
  • A command must contain a destinatary.

Implement a build initial connection request

A Build initial connection request must be implemented.

  • A game engine must process this request only if the turn is started.
  • A game engine must process this request only if the active player is the request sender.
  • A game engine must process this request only if the game state is GameState.FOUNDATION.
  • A game engine must consider an error to process more than one valid request of this type at the same turn.
  • A game engine must build the connection without substracting resources.

Resolve compiler warning

/home/runner/work/catan-heroes/catan-heroes/src/com/catanheroes/core/game/log/IGameLog.java:23: warning: no @param for turn

Fix POM

Maven central has its own POM requirements. They must be fullfilled in order to publish a release.

Invalid POM: /io/github/notaphplover/catan-core/0.3.0/catan-core-0.3.0.pom: Project name missing, Project description missing, Project URL missing, License information missing, SCM URL missing, Developer information missing

Add a way to get Player requests without deleting them

Almost any client library would require serialization layer able to serialize requests.

In order to achieve this, it's required a request getter which does not modify a player instance.

  • Collection<IRequest> emptyMissing() must be removed.
  • Collection<IRequest> getMissingRequests() must be added.
  • void emptyMissingRequests() must be added.

Simplify CatanBoard

CatanBoard and CatanEditableBoard must be a single class.
The logic to store the production must be moved to a new class ProductionManager

Implement an inmutable resource manager.

I realice that several parts of the code demand an inmutable resource manager. We are currently solving this cloning entities to ensure data is not updated, but it's just a workaround.

An interface and a class must be implemented in order to satisfy that requirements.

cc @abvg9

Fix bad active player calculus

The game now calculates the active player based on turnNumber % players.length.

  • The real modulus should be players.length - 1.
  • If there is a single player, the active player is the first one.
  • A test must be added to ensure that the active player is correctly calculated.

Add turn data to any command.

Any command must contain the history of changes of the current turn in order to allow player agents to sync its inner state.

Add a command sender.

Important: This feature requires #66, #68 to be closed before starting any development process related to this issue.

The game needs a tool to send commands to the players.

  • A command sender interface must be added in order to send commands.
  • Game engine must be able to contain a command sender.
  • Game engine handlers must be updated in order to send commands:
    • An end turn request handler must send a command to start playing the next turn. If the game is ended, it must send a command to stop players.
    • A start turn request must send a command to play the turn with the game state.
    • Any other request must send a continue playing turn command (as a kind of ACK).

Implement a trade system

A trade system must be implemented in order to allow clients to trade resources.

  • Only player to player trades must be implemented.
  • Only the active player can perform a trade request.

Trade requests details are the following ones:

  • A trade request contains the desired resources.
  • A trade request contains the collection of acceptable trades.

It would be reasonable to use a wildcard value in order to reduce the size of the acceptable trades collection.

Catan game engine must not process a batch of requests.

Communication could be too complex if the engine is able to process a batch of requests.

The game engine must be refactored in order to process just a single request.

Important: This task is probably a bottleneck in the develop process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.