diff --git a/src/components/Die.vue b/src/components/Die.vue index 086a372..3453df1 100644 --- a/src/components/Die.vue +++ b/src/components/Die.vue @@ -1,5 +1,5 @@ + + diff --git a/src/components/GameRulesEditor.vue b/src/components/GameRulesEditor.vue new file mode 100644 index 0000000..d84f3f9 --- /dev/null +++ b/src/components/GameRulesEditor.vue @@ -0,0 +1,127 @@ + + + diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 528d0bd..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - diff --git a/src/components/RoundTurns.vue b/src/components/RoundTurns.vue index 7a59624..6a6ed3f 100644 --- a/src/components/RoundTurns.vue +++ b/src/components/RoundTurns.vue @@ -11,7 +11,7 @@ - + x diff --git a/src/objects/objects.ts b/src/objects/objects.ts index 5932d58..fea39c5 100644 --- a/src/objects/objects.ts +++ b/src/objects/objects.ts @@ -38,6 +38,19 @@ export interface GameStateObject { players: PlayerObject[], currentPlayer: PlayerObject, owningPlayer: PlayerObject, + rules: GameRules +} + +export interface GameRules { + startDicePerPlayer: number, + higherCountLowerValueEnabled: boolean, + jokerCountsDouble: boolean, + jokerEnabled: boolean, + palificoEnabled: boolean, + calzaEnabled: boolean, + jokerDieValue: number, + randomPlayerOrder: boolean, + anonymizePlayers: boolean, } export interface RoundObject { diff --git a/src/router/index.ts b/src/router/index.ts index 18197f3..1741597 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,6 +5,7 @@ import 'vue-material/dist/vue-material.min.css' import 'vue-material/dist/theme/default-dark.css' import MdButton from 'vue-material/dist/components/MdButton'; +import MdCheckbox from 'vue-material/dist/components/MdCheckbox'; import MdField from 'vue-material/dist/components/MdField'; import MdApp from 'vue-material/dist/components/MdApp'; import MdAppContent from 'vue-material/dist/components/MdContent'; @@ -12,6 +13,7 @@ Vue.use(MdButton); Vue.use(MdField); Vue.use(MdApp); Vue.use(MdAppContent); +Vue.use(MdCheckbox) Vue.use(VueRouter) diff --git a/src/services/PerudoApi.ts b/src/services/PerudoApi.ts index 7dddbd5..9debab9 100644 --- a/src/services/PerudoApi.ts +++ b/src/services/PerudoApi.ts @@ -1,5 +1,13 @@ import axios, {AxiosPromise, AxiosResponse} from 'axios' -import {JoinCreateGameObject, IsStartedObject, ApiObject, GameStateObject, MyTurnObject, GuessAction} from "@/objects/objects"; +import { + JoinCreateGameObject, + IsStartedObject, + ApiObject, + GameStateObject, + MyTurnObject, + GuessAction, + GameRules +} from "@/objects/objects"; export default class PerudoApi { private static baseUrl = process.env.VUE_APP_BASE_URL; @@ -27,6 +35,13 @@ export default class PerudoApi { }) } + public setGameRules(playerId: string, rules: GameRules): Promise { + return this.post('game/rules/' + playerId, rules) + .then((response: AxiosResponse) => { + return response.data; + }); + } + public gameStarted(playerId: string): Promise { return this.get('game/started/' + playerId) .then((response: AxiosResponse) => { diff --git a/src/typings/vue-material.d.ts b/src/typings/vue-material.d.ts index 1eaf985..14940d2 100644 --- a/src/typings/vue-material.d.ts +++ b/src/typings/vue-material.d.ts @@ -1,5 +1,6 @@ declare module 'vue-material'; declare module 'vue-material/dist/components/MdButton'; +declare module 'vue-material/dist/components/MdCheckbox'; declare module 'vue-material/dist/components/MdField'; declare module 'vue-material/dist/components/MdApp'; declare module 'vue-material/dist/components/MdContent'; diff --git a/src/views/Home.vue b/src/views/Home.vue index 2bccacc..3ece28a 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -39,8 +39,8 @@ Die value:
- - + +

Guess Call @@ -62,6 +62,8 @@ +
+ @@ -70,7 +72,8 @@ - -