Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Cards in hand identified by independent index #55

Closed
5 tasks done
Masclins opened this issue Mar 7, 2018 · 19 comments
Closed
5 tasks done

Cards in hand identified by independent index #55

Masclins opened this issue Mar 7, 2018 · 19 comments
Assignees
Labels
0 - Critical Rolled a 20

Comments

@Masclins
Copy link
Collaborator

Masclins commented Mar 7, 2018

We are changing almost everything (mostly backend) so we have an array of all the cards (therefore, identified by an independent index). Cards in this array will have an attribute showing the zone in which the card is. That means a change from "Zones with cards" to "Cards in zones".

Everything from backend/src/rules is already changed, including tests.
backend/src/api needs to have the tests changed so they use the format "one-test-file-per-src-file".
Now the following needs to be done:

  • Double-check backend tests (and add any that's needed/missing)

  • Tests for api/base.clj: Put the current ones together.

  • Tests for api/base.clj: Test (play-card-as-player

  • Tests for api/conversions.clj, api/generators.clj and api/handler.clj. This should be pretty easy, since most of those don't do much.

  • Adapt all tests on backend/old_tests/ (this should be covered by the previous two points, but just in case...)

@kenan-rhoton
Copy link
Owner

Giving cards an id field?

@Masclins
Copy link
Collaborator Author

Masclins commented Mar 7, 2018

Yes.

And I assume it would be best if it's different for every card (so no shared id between my cards and my opponent's)

@kenan-rhoton
Copy link
Owner

Should be assigned on game creation then

@kenan-rhoton kenan-rhoton added this to the Release v0.1.1 milestone Mar 7, 2018
@Masclins Masclins assigned Masclins and unassigned Masclins Mar 7, 2018
@Masclins
Copy link
Collaborator Author

Masclins commented Mar 8, 2018

I'd like to hear from @pernilsalat and what advantages this would have, before begining working on it.

@kenan-rhoton
Copy link
Owner

Right now zero, it will probably be useful in the future (especially if we want to allow a player to reorganize cards in his hand in frontend). Wait, I assigned this to v0.1.0? Woah, I must've been drunk.

@kenan-rhoton kenan-rhoton removed this from the Release v0.1.1 milestone Mar 8, 2018
@Masclins
Copy link
Collaborator Author

Masclins commented Mar 13, 2018

Thinking about Issue #41 it would probably be useful to have cards identified by id, those on the board too.

@kenan-rhoton
Copy link
Owner

Yes, as card move zones they should keep their id.

@Masclins
Copy link
Collaborator Author

It seems like we are working on targets before giving id to cards.
Do we really want :target to be a path, rather than an :id?

@kenan-rhoton
Copy link
Owner

I know I don't 🙃

@kenan-rhoton kenan-rhoton added this to the Release v0.2.0 milestone Mar 21, 2018
@kenan-rhoton kenan-rhoton self-assigned this Mar 22, 2018
@Masclins
Copy link
Collaborator Author

:target has been implemented to be a path (shouldn't be hard to change).

The thing is... Knowing the :id of a card is easy, while knowing it's path is not that easy (specially when frontend will have to tell backend its path).
On the other hand, finding where a card that has to be changed, based on :id might be hard, while doing so with path is easy.

I'd like frontend to have the easiest job here. Therefore, I'd definitely go for :id, knowing that we'll need a function to translate an :id to a path.

@Masclins
Copy link
Collaborator Author

Masclins commented Apr 9, 2018

Maybe will re-open if find any reason to do so.

@Masclins Masclins removed this from the Release v0.2.0 milestone Apr 10, 2018
@Masclins
Copy link
Collaborator Author

After @pernilsalat suggesting again to use id's in order to solve the problems seen in #119, I reopen this issue.

@kenan-rhoton kenan-rhoton added 0 - Critical Rolled a 20 and removed enhancement labels Aug 30, 2018
@Masclins
Copy link
Collaborator Author

After doublechecking #122, almost everything is done on backend.

I'll be double-checking the rules/, @kenan-rhoton, would you mind changing the tests for the api/?

From here, @pernilsalat you should be able to work on frontend.

@kenan-rhoton
Copy link
Owner

I am first priorizing the server and travis, then I'll get on this ticket

@Masclins
Copy link
Collaborator Author

I begun the required changes on the branch mod-new-paradigm.

@kenan-rhoton
Copy link
Owner

If you've done a relevant change (such as grouping the test) can you please issue the pull request already and merge to develop? We should merge quick and small changes often, rather than big merges whenever possible

@Masclins Masclins added this to the Release v0.2.0 milestone Sep 3, 2018
@kenan-rhoton
Copy link
Owner

Currently taking a look at the missing files to determine the needed tests

@kenan-rhoton
Copy link
Owner

  • api/handler.clj is just interfacing with Compojure and Cheshire (our server and JSON libraries, respectively), so testing it would be testing those libraries which we can safely assume work correctly.
  • api/generators.clj is just a randomness provider, which just uses java.util.UUID/randomUUID, so nothing to test.
  • api/conversions.clj on the other hand does logic to translate between the internal rules player-id and the tags the players actually get to prevent them from knowing their opponent's session ID, and thus should be tested.

@kenan-rhoton
Copy link
Owner

Soooo... this is funny, conversions is no longer used anywhere, it's just legacy stuff, I'm deleting it 🙃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0 - Critical Rolled a 20
Projects
None yet
Development

No branches or pull requests

2 participants