Commit 463334e4 authored by Corentin Guillevic's avatar Corentin Guillevic
Browse files

Add master modification ; Add some page in not-alone-web

parent d896d37e
......@@ -21,7 +21,9 @@
"dependencies": {
"@creditkarma/thrift-client": "^0.16.1",
"@creditkarma/thrift-server-core": "^0.16.1",
"@creditkarma/thrift-server-express": "^0.16.1"
"@creditkarma/thrift-server-express": "^0.16.1",
"@types/express": "^4.17.9",
"express": "^4.17.1"
},
"browser": {
"crypto": false,
......
export enum PlayerTeam {
CREATURE,
TRAQUES
}
import { TPlayerTeam } from 'src/codegen/common';
import { PlayerTeam } from '../items/player-team';
export class Conversion {
public static toPlayerTeam(tTeam: TPlayerTeam): PlayerTeam {
if (tTeam.type === 'CREATURE') {
return PlayerTeam.CREATURE;
} else if (tTeam.type === 'TRAQUES') {
return PlayerTeam.TRAQUES;
} else {
throw new Error(tTeam.type + ' is not a valid PlayerTeam');
}
}
}
import { TDescription, TPlayerTeam, TPhase, TAction, TAskAction, Response } from 'src/codegen/common';
import { PlayerTeam } from 'src/game/items/player-team';
import { Conversion } from 'src/game/utilitary/conversion';
// import { IHandler } from '../codegen/common/GameService';
import { IHandler } from '../codegen/common/PlayerService';
import { PlayerService } from '../player/player-service';
export class ClientServiceHandler<Context> implements IHandler<Context> {
private service: PlayerService;
constructor() {
......@@ -39,6 +41,7 @@ export class ClientServiceHandler<Context> implements IHandler<Context> {
}
public sendGameIsFinished(winner: TPlayerTeam): void | Promise<void> {
const team: PlayerTeam = Conversion.toPlayerTeam(winner);
throw new Error('Method not implemented.');
}
......
import { AppRoutingModule } from './app-routing.module';
describe('AppRoutingModule', () => {
let appRoutingModule: AppRoutingModule;
beforeEach(() => {
appRoutingModule = new AppRoutingModule();
});
it('should create an instance', () => {
expect(appRoutingModule).toBeTruthy();
});
});
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { GameComponent } from './game/game.component';
import { HelpComponent } from './help/help.component';
import { HomeComponent } from './home/home.component';
import { RoomComponent } from './room/room.component';
const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'room', component: RoomComponent },
{ path: 'game', component: GameComponent },
{ path: 'help', component: HelpComponent }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
font-family: Arial, Helvetica, sans-serif;
vertical-align: baseline;
}
html, body{
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: auto;
}
body{
background-color: #2c3e50;
color: #ededed;
}
\ No newline at end of file
<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
<h2>Here are some links to help you start: </h2>
<ul>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
</li>
</ul>
<app-navbar></app-navbar>
<router-outlet></router-outlet>
\ No newline at end of file
import { Component } from '@angular/core';
import { ViewEncapsulation } from '@angular/core'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
templateUrl: './app.component.html',
encapsulation: ViewEncapsulation.None,
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'not-alone-web';
title = 'Not alone';
}
......@@ -2,13 +2,25 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { RoomComponent } from './room/room.component';
import { HelpComponent } from './help/help.component';
import { NavbarComponent } from './navbar/navbar.component';
import { HomeComponent } from './home/home.component';
import { GameComponent } from './game/game.component';
@NgModule({
declarations: [
AppComponent
AppComponent,
RoomComponent,
HelpComponent,
NavbarComponent,
HomeComponent,
GameComponent
],
imports: [
BrowserModule
BrowserModule,
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { GameComponent } from './game.component';
describe('GameComponent', () => {
let component: GameComponent;
let fixture: ComponentFixture<GameComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GameComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(GameComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-game',
templateUrl: './game.component.html',
styleUrls: ['./game.component.css']
})
export class GameComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<h2>Here are some links to help you start: </h2>
<ul>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
</li>
</ul>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HelpComponent } from './help.component';
describe('HelpComponent', () => {
let component: HelpComponent;
let fixture: ComponentFixture<HelpComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HelpComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HelpComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-help',
templateUrl: './help.component.html',
styleUrls: ['./help.component.css']
})
export class HelpComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
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