Commit bf65f0e5 authored by Mamadou Diallo's avatar Mamadou Diallo

Dernière version run

parent 5cd76d74
@startuml
package model{
package interfaces{
interface CardInterface{
getId() : UUID
getPhase() : Phase
getDescription() : String
getTitle() : Object
}
interface PlayerInterface{
getHand() : CardInterface[*]
getDiscards() : CardInterface[*]
getPlayedCards() : CardInterface[*]
getName() : String
getId() : UUID
}
}
package cards{
abstract class Card{
title : Object
description : String
id : UUID
Card(title: Object, phase: Phase)
generateId() : UUID
toString() : String
addDescription(cardTilte: Object): String
effect(cardTitle: Object)
}
class Lieu{
Lieu(title: LieuTile, phase: Phase)
abriEffect()
jungleEffect()
riviereEffect()
plageEffect()
roverEffect()
maraisEffect()
antreEffect()
epaveEffect()
sourceEffect()
artifactEffect()
}
class Survie{
Survie(title: SurvieTitle, phase: Phase)
vortexEffect()
esquiveEffect()
riposteEffect()
volteFaceEffect()
}
class Traque{
Traque(title: TraqueTitle, phase:Phase)
mutationEffect()
flashBackEffect()
acharnementEffect()
champsDeForceEffect()
}
}
package players{
class Player{
id: UUID
name: String
Player(name: String)
getId() : UUID
getName() : String
getHand() : CardInterface[*]
getDiscards() : CardInterface[*]
getPlayedCards() : CardInterface[*]
initialize()
draw(nbOfCards: Integer)
toString(): String
}
class Creature{
Creature(name: String)
toTraque(traqued: Tracked)
}
class Tracked{
Tracked(name: String)
letGo()
resist()
}
class MasterPlayer{
}
}
package util{
enum LieuTile{
ANTRE
JUNGLE
RIVIERE
PLAGE
ROVER
MARAIS
ABRI
EPAVE
SOURCE
ARTEFACT
}
enum Phase{
ONE
TWO
THREE
FOUR
}
enum SurvieTitle{
RIPOSTE
VORTEX
ESQUIVE
VOLTE_FACE
}
enum TraqueTitle{
ACHARNEMENT
CHAMPS_DE_FORCE
FLASHBACK
MUTATION
}
}
package pawns{
enum PawnName{
BALISE
ASSIMILATION
SECOURS
VOLONTE
.................
}
class Pawn{
Pawn(name: PawnName)
getName(): PawnName
}
Pawn *--"has Name [1]" PawnName
}
package tokens{
enum TokenName{
CIBLE
CREATURE
ARTEMIA
}
class Token{
Token(name: TokenName)
getName(): TokenName
}
Token *--"has Name [1]" TokenName
}
CardInterface <|.. Card
PlayerInterface <|.. Player
Card <|-- Lieu
Card <|-- Survie
Card <|-- Traque
Player <|-- Creature
Player <|-- Tracked
Player *--"hand [0..n]" CardInterface
Player *--"discards [0..n]\n" CardInterface
Player *--"playedCards [0..n]" CardInterface
Creature *-- "uses [0..n]" Lieu
Creature *-- "uses [0..n]" Traque
Card *-- "hasPhase [1]" Phase
Tracked *-- "hasCards [0..n]" Survie
Lieu *-- "hasTitle [1] \n\n" LieuTile
Survie *-- "hasTitle [1]" SurvieTitle
Traque *-- "hasTitle [1]" TraqueTitle
}
@enduml
package fr.univnantes.alma;
//import fr.univnantes.alma.thrift.GameServerService;
import fr.univnantes.alma.thrift.GameServerService;
import fr.univnantes.alma.handler.GameServiceHandler;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocolFactory;
......@@ -12,7 +12,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Servlet;
@Configuration
@EnableAutoConfiguration
......
package fr.univnantes.alma.common;
import fr.univnantes.alma.common.GameJoinRequest;
public interface GameService {
/**
......
package fr.univnantes.alma.game;
public class InitData {
}
package fr.univnantes.alma.handler;
import fr.univnantes.alma.common.GameJoinRequest;
import fr.univnantes.alma.core.InvalidOperationException;
import fr.univnantes.alma.thrift.InvalidOperationException;
import fr.univnantes.alma.thrift.GameNotFound;
import fr.univnantes.alma.thrift.GameServerService;
import fr.univnantes.alma.thrift.JoinRequest;
......@@ -30,25 +30,5 @@ public class GameServiceHandler implements GameServerService.Iface {
//TODO: translate JoinRequest into GameJoinRequest
return service.join(gameId, new GameJoinRequest());
}
@Override
public CrossPlatformResource get(int id) throws InvalidOperationException, TException {
return null;
}
@Override
public List<CrossPlatformResource> getList() throws InvalidOperationException, TException {
return null;
}
@Override
public boolean ping() throws InvalidOperationException, TException {
return false;
}
@Override
public void save(CrossPlatformResource resource) throws InvalidOperationException, TException {
}
}
......@@ -12,7 +12,6 @@ public class Lieu extends Card{
public Lieu(LieuTitle title) {
super(title);
this.id = this.generateId();
}
......
......@@ -23,11 +23,14 @@ public class Creature extends Player{
}
i++;
}
if(card != null && !tracked.resist()){
if(card != null){
boolean resist = tracked.resist();
if(!resist){
this.getHand().get(i).setPower(true);
this.assimilate(tracked);
this.getHand().remove(card);
}
}
}
......
package fr.univnantes.alma;
import fr.univnantes.alma.model.cards.Lieu;
import fr.univnantes.alma.model.inerfaces.CardInterface;
import fr.univnantes.alma.model.utlis.LieuTitle;
import fr.univnantes.alma.model.utlis.Phase;
import org.junit.jupiter.api.Test;
public class CardTest {
@Test
public void createCardTest(){
CardInterface card = new Lieu(LieuTitle.ABRI, Phase.ONE);
System.out.println(card.toString());
//assertEquals (card.getPhase(), Phase.ONE);
}
}
......@@ -2886,6 +2886,11 @@
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
"dev": true
},
"bootstrap": {
"version": "4.5.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.3.tgz",
"integrity": "sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ=="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
......@@ -6875,6 +6880,11 @@
}
}
},
"jquery": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
......
......@@ -25,7 +25,9 @@
"@creditkarma/thrift-typescript": "^3.7.6",
"@ngtools/webpack": "^10.1.3",
"@types/thrift": "^0.10.10",
"bootstrap": "^4.5.3",
"core-js": "^3.6.5",
"jquery": "^3.5.1",
"marked": "^1.2.0",
"rxjs": "~6.6.3",
"thrift": "^0.13.0",
......
......@@ -5,13 +5,19 @@ import { AppComponent } from './app.component';
import { JetonsComponent } from './jetons/jetons.component';
import { PionsComponent } from './pions/pions.component';
import { PisteComponent } from './piste/piste.component';
import { CardComponent } from './cards/card/card.component';
import { CardsListComponent } from './cards/cards-list/cards-list.component';
import { CardDetailComponent } from './cards/card-detail/card-detail.component';
@NgModule({
declarations: [
AppComponent,
JetonsComponent,
PionsComponent,
PisteComponent
PisteComponent,
CardComponent,
CardsListComponent,
CardDetailComponent
],
imports: [
BrowserModule
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CardDetailComponent } from './card-detail.component';
describe('CardDetailComponent', () => {
let component: CardDetailComponent;
let fixture: ComponentFixture<CardDetailComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CardDetailComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CardDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import {Observable} from "rxjs";
import {Card} from "../card";
@Component({
selector: 'app-card-detail',
templateUrl: './card-detail.component.html',
styleUrls: ['./card-detail.component.css']
})
export class CardDetailComponent implements OnInit {
cards: Observable<Card[]>;
constructor(private cardService: CardService, ) { }
ngOnInit(): void {
}
}
import { TestBed } from '@angular/core/testing';
import { CardService } from './card.service';
describe('CardService', () => {
let service: CardService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(CardService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {Observable} from "rxjs";
@Injectable({
providedIn: 'root'
})
export class CardService {
private baseUrl = "";
constructor(private http: HttpClient) {}
getCard(id: number): Observable<any>{
return null;
}
}
export class Card {
id: Object;
phase: Object;
title: Object;
description: string
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CardComponent } from './card.component';
describe('CardComponent', () => {
let component: CardComponent;
let fixture: ComponentFixture<CardComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CardComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-card',
templateUrl: './card.component.html',
styleUrls: ['./card.component.css']
})
export class CardComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CardsListComponent } from './cards-list.component';
describe('CardsListComponent', () => {
let component: CardsListComponent;
let fixture: ComponentFixture<CardsListComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CardsListComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CardsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import {Observable} from "rxjs";
import {Card} from "../card";
import {CardService} from "../card.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-cards-list',
templateUrl: './cards-list.component.html',
styleUrls: ['./cards-list.component.css']
})
export class CardsListComponent implements OnInit {
cards: Observable<Card[]>;
constructor(private cardService: CardService, private router: Router) { }
ngOnInit(): void {
this.reloadData();
}
reloadData(){
this.cards = null;
}
cardDetails(id: Object){
this.router.navigate(['details', id]);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment