vartanbeno / pokemon Goto Github PK
View Code? Open in Web Editor NEWPokemon Trading Card Game. Web app featuring various architectural patterns.
License: MIT License
Pokemon Trading Card Game. Web app featuring various architectural patterns.
License: MIT License
When creating a deck, you should also be able to create a card like:
<type> <NAME> <BASIC>
p "Charmeleon" "Charmander"
Playing an energy card attaches it to a Pokemon card that is on the bench. The energy card is removed from the player's hand. It can only be done once per turn.
The TDG will basically be split into a TDG and a finder.
TDG will have the following methods:
createTable
dropTable
insert
update
delete
getMaxId
And the Finder will have all find
methods, such as findAll()
, findById
, etc.
Input mappers contain various find
methods.
Output mappers contain insert
, update
, and delete
methods.
turn
represents the nth turn in the game; should be incremented after a player ends their turn.
version
should be incremented after each state change in a game, i.e. a card play and an end turn.
We'll use the turn
attribute to keep track of whether or not a player can play an energy card, since they can only play one per turn. Right now, we use the game version, but since we have to increment it after every state change, it's hard to track.
The data previously stored in an RDG will now be in the domain object. The mappers will take parameters from the domain object, and will send instructions to the TDG to execute the desired queries.
I have it set to 5, should be taken out.
Example: use /Game/:id
instead of /Game?game=1
The identity map design pattern is a means of improving performance by using an in-memory cache to prevent multiple retrievals of the same item from a database.
Example:
The first time we fetch the user with ID 1, we query the database and the User object is stored in the IdentityMap. Every subsequent call to fetch this same user will fetch it directly from the IdentityMap, which stores its objects in a Map.
In src/
, there should be a FrontController
class which extends DispatcherServlet
from SoenEA, and in src/app
, there should be Dispatcher
classes which extend Dispatcher
from SoenEA.
The FrontController
takes care of the delegation of the request to one of the dispatchers, depending on the path of the request.
Edit:
We could also use SmartDispatcherServlet
and SmartDispatcher
.
Edit 2:
We should also include Command
classes, which extend either Command
or ValidatorCommand
from SoenEA, in src/dom/command
.
Right now, for example if make a POST request to /Poke/Game/1/Hand/0/Play?version=1
, it plays the 1st card in your hand, because we chose 0, and that's the first element in a 0-based index in your hand.
We don't want to go off of a card's position, we want to specify its ID.
Create a class called Global
or something to store Strings that are JSP files. It's better to reference them that, instead of creating new variables every time we want to reference them.
/Poke/Game/\\d+/EndTurn
, with an appropriate game ID.
When a game first starts, it is the challenger's turn. They start with one card already drawn from their deck.
If a turn ends and a player has more than 7 cards in their hand, the oldest card in their hand moves to the top of their discard pile.
When a player ends their turn:
Issue #41 should be done first.
A Pokemon that replaces its basic version should keep all attached energies.
Pretty much every endpoint where we manipulate (update/delete) an object should contain its version as a query parameter (?version=[version]
).
If we try to update/delete a record and the version we got doesn't match the version that the record currently holds, it most likely means that someone edited it between the time we retrieved it, and the time we sent the info back to the database. In this case, we should get a LostUpdateException
.
Retire
doesn't need to though. A player should retire from a game regardless of a version, no need to throw a LostUpdateException
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.