Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Corentin GUILLEVIC
Not Alone
Commits
463334e4
Commit
463334e4
authored
Dec 11, 2020
by
Corentin Guillevic
Browse files
Add master modification ; Add some page in not-alone-web
parent
d896d37e
Changes
58
Hide whitespace changes
Inline
Side-by-side
not-alone-player/package.json
View file @
463334e4
...
...
@@ -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
,
...
...
not-alone-player/src/game/items/player-team.ts
0 → 100644
View file @
463334e4
export
enum
PlayerTeam
{
CREATURE
,
TRAQUES
}
not-alone-player/src/game/utilitary/conversion.ts
0 → 100644
View file @
463334e4
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
'
);
}
}
}
not-alone-player/src/handler/client-service-handler.ts
View file @
463334e4
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.
'
);
}
...
...
not-alone-web/src/app/app-routing.module.spec.ts
0 → 100644
View file @
463334e4
import
{
AppRoutingModule
}
from
'
./app-routing.module
'
;
describe
(
'
AppRoutingModule
'
,
()
=>
{
let
appRoutingModule
:
AppRoutingModule
;
beforeEach
(()
=>
{
appRoutingModule
=
new
AppRoutingModule
();
});
it
(
'
should create an instance
'
,
()
=>
{
expect
(
appRoutingModule
).
toBeTruthy
();
});
});
not-alone-web/src/app/app-routing.module.ts
0 → 100644
View file @
463334e4
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
{
}
not-alone-web/src/app/app.component.css
View file @
463334e4
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
not-alone-web/src/app/app.component.html
View file @
463334e4
<!--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
not-alone-web/src/app/app.component.ts
View file @
463334e4
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
=
'
n
ot
-
alone
-web
'
;
title
=
'
N
ot
alone
'
;
}
not-alone-web/src/app/app.module.ts
View file @
463334e4
...
...
@@ -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
]
...
...
not-alone-web/src/app/game/game.component.css
0 → 100644
View file @
463334e4
not-alone-web/src/app/game/game.component.html
0 → 100644
View file @
463334e4
<p>
game works!
</p>
not-alone-web/src/app/game/game.component.spec.ts
0 → 100644
View file @
463334e4
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
();
});
});
not-alone-web/src/app/game/game.component.ts
0 → 100644
View file @
463334e4
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
()
{
}
}
not-alone-web/src/app/help/help.component.css
0 → 100644
View file @
463334e4
not-alone-web/src/app/help/help.component.html
0 → 100644
View file @
463334e4
<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
not-alone-web/src/app/help/help.component.spec.ts
0 → 100644
View file @
463334e4
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
();
});
});
not-alone-web/src/app/help/help.component.ts
0 → 100644
View file @
463334e4
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
()
{
}
}
not-alone-web/src/app/home/home.component.css
0 → 100644
View file @
463334e4
not-alone-web/src/app/home/home.component.html
0 → 100644
View file @
463334e4
<p>
home works!
</p>
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment