Commit b91bedb5 authored by Mamadou Diallo's avatar Mamadou Diallo
Browse files

Une autre tentative d'ajout de commit du modèle

parent 7a0ee393
......@@ -123,5 +123,8 @@
}
}
},
"defaultProject": "not-alone-web"
"defaultProject": "not-alone-web",
"cli": {
"analytics": false
}
}
\ No newline at end of file
.jetons{
text-align: left;
}
.pions{
text-align: left;
}
<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
Welcome to {{ title }} ! <br>
<div>
<nav class="jetons">
<div>
<app-jetons></app-jetons>
</div>
</nav>
<nav class="pions">
<div>
<app-pions></app-pions>
</div>
</nav>
<nav class="piste">
<app-piste></app-piste>
</nav>
</div>
</h1>
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
......
import { Component } from '@angular/core';
import {JetonAndPionObject} from './jetonAndPionObject';
@Component({
selector: 'app-root',
......
......@@ -2,10 +2,16 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { JetonsComponent } from './jetons/jetons.component';
import { PionsComponent } from './pions/pions.component';
import { PisteComponent } from './piste/piste.component';
@NgModule({
declarations: [
AppComponent
AppComponent,
JetonsComponent,
PionsComponent,
PisteComponent
],
imports: [
BrowserModule
......
export class Helper extends RTCIdentityAssertion {
public static dirtyDraw(): void {
// Create and attach Canvas to the DOM
const canvas = document.createElement('canvas');
canvas.setAttribute('width', '500px');
canvas.setAttribute('height', '500px');
document.body.appendChild(canvas);
// draw red square
// tslint:disable-next-line:no-non-null-assertion
const ctx = canvas.getContext('2d')!;
ctx.beginPath();
ctx.fillStyle = 'rgb(255,0,0)';
ctx.rect(10, 10, 50, 50);
ctx.fill();
}
}
export interface Jeton {
export interface JetonAndPionObject {
id: number;
name: string;
// icone: any;
}
<p>jetons works!</p>
<table>
<td *ngFor=" let jeton of listOfJetons " (click)="foo(jeton)"><img src="" alt=""> {{jeton.name}} &nbsp; &nbsp;</td>
</table>
import { Component, OnInit } from '@angular/core';
import {JetonAndPionObject} from '../jetonAndPionObject';
import {View} from '../view';
@Component({
selector: 'app-jetons',
......@@ -7,6 +9,20 @@ import { Component, OnInit } from '@angular/core';
})
export class JetonsComponent implements OnInit {
listOfJetons: JetonAndPionObject[] = [
{id: 1, name: 'Cible'},
{id: 2, name: 'Créature'},
{id: 3, name: 'Artemia'}
];
foo(component: JetonAndPionObject) {
alert(component.name);
}
draw(): void {
View.dirtyDraw();
}
constructor() { }
ngOnInit(): void {
......
<p>pions works!</p>
<table>
<td *ngFor="let pion of listOfPions" (click)="foo(pion)"> {{pion.name}} &nbsp; &nbsp; </td>
</table>
import { Component, OnInit } from '@angular/core';
import {JetonAndPionObject} from '../jetonAndPionObject';
@Component({
selector: 'app-pions',
......@@ -7,6 +9,18 @@ import { Component, OnInit } from '@angular/core';
})
export class PionsComponent implements OnInit {
listOfPions: JetonAndPionObject[] = [
{id: 1, name: 'Balise'},
{id: 2, name: 'Secours'},
{id: 3, name: 'Assimilation'},
{id: 2, name: 'Volonté'}
];
foo(component: JetonAndPionObject) {
alert(component.name);
}
constructor() { }
ngOnInit(): void {
......
canvas {
margin: 0;
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<p>piste works!</p>
<div id="piste" >
{{executeDraw()}}
</div>
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-piste',
templateUrl: './piste.component.html',
......@@ -7,6 +8,31 @@ import { Component, OnInit } from '@angular/core';
})
export class PisteComponent implements OnInit {
public static dirtyDraw(): void {
// Create and attach Canvas to the DOM
const canvas = document.createElement('canvas');
canvas.setAttribute('width', '500px');
canvas.setAttribute('height', '500px');
document.getElementById('piste').appendChild(canvas);
// draw red square
// tslint:disable-next-line:no-non-null-assertion
const ctx = canvas.getContext('2d')!;
ctx.beginPath();
const size = 100;
const offset = 10;
ctx.fillStyle = 'rgb(255,0,0)';
for (let i = 0; i < 8; i++) {
for (let j = 0; j < 4; j++) {
ctx.rect((size + offset) * i, (size + offset) * j, size, size);
ctx.fill();
}
}
}
public executeDraw(): void {
PisteComponent.dirtyDraw();
}
constructor() { }
ngOnInit(): void {
......
export class View {
public static dirtyDraw(): void {
// Create and attach Canvas to the DOM
const canvas = document.createElement('canvas');
canvas.setAttribute('width', '500px');
canvas.setAttribute('height', '500px');
document.body.appendChild(canvas);
// draw red square
// tslint:disable-next-line:no-non-null-assertion
const ctx = canvas.getContext('2d')!;
ctx.beginPath();
ctx.fillStyle = 'rgb(255,0,0)';
ctx.rect(10, 10, 50, 50);
ctx.fill();
}
}
1) Est-ce qu'on peut ajouter les classes et fonctio définies dans le package "game" dans le fichier game-server.thrift
Classes Proxy aux côté Serveur qui communique avec le service client
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