From d91dd7087b1561b35a96f5424cdc36615ad45235 Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sat, 24 Mar 2018 09:08:06 -0400 Subject: [PATCH 1/8] Started classes --- Casino/Gamble.ts | 0 Casino/GameEngine.ts | 0 Casino/GameEngineInterface.ts | 0 Casino/GameInterface.ts | 0 Casino/Player.ts | 0 Casino/PlayerInterface.ts | 0 Casino/Profile.ts | 0 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Casino/Gamble.ts create mode 100644 Casino/GameEngine.ts create mode 100644 Casino/GameEngineInterface.ts create mode 100644 Casino/GameInterface.ts create mode 100644 Casino/Player.ts create mode 100644 Casino/PlayerInterface.ts create mode 100644 Casino/Profile.ts diff --git a/Casino/Gamble.ts b/Casino/Gamble.ts new file mode 100644 index 00000000..e69de29b diff --git a/Casino/GameEngine.ts b/Casino/GameEngine.ts new file mode 100644 index 00000000..e69de29b diff --git a/Casino/GameEngineInterface.ts b/Casino/GameEngineInterface.ts new file mode 100644 index 00000000..e69de29b diff --git a/Casino/GameInterface.ts b/Casino/GameInterface.ts new file mode 100644 index 00000000..e69de29b diff --git a/Casino/Player.ts b/Casino/Player.ts new file mode 100644 index 00000000..e69de29b diff --git a/Casino/PlayerInterface.ts b/Casino/PlayerInterface.ts new file mode 100644 index 00000000..e69de29b diff --git a/Casino/Profile.ts b/Casino/Profile.ts new file mode 100644 index 00000000..e69de29b From e9cc79fb23c82ff8953eaf867ccdd8bbcbaba094 Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sat, 24 Mar 2018 12:54:35 -0400 Subject: [PATCH 2/8] Made js files --- Casino/Gamble.ts | 3 +++ Casino/GameEngine.ts | 3 +++ Casino/GameInterface.ts | 3 +++ Casino/Player.ts | 3 +++ Casino/PlayerInterface.ts | 5 +++++ Casino/Profile.ts | 7 +++++++ Casino/js/Gamble.js | 6 ++++++ Casino/js/Gamble.js.map | 1 + Casino/js/GameEngine.js | 6 ++++++ Casino/js/GameEngine.js.map | 1 + Casino/js/GameEngineInterface.js | 1 + Casino/js/GameEngineInterface.js.map | 1 + Casino/js/GameInterface.js | 1 + Casino/js/GameInterface.js.map | 1 + Casino/js/Player.js | 6 ++++++ Casino/js/Player.js.map | 1 + Casino/js/PlayerInterface.js | 1 + Casino/js/PlayerInterface.js.map | 1 + Casino/js/Profile.js | 6 ++++++ Casino/js/Profile.js.map | 1 + Casino/tsconfig.json | 11 +++++++++++ 21 files changed, 69 insertions(+) create mode 100644 Casino/js/Gamble.js create mode 100644 Casino/js/Gamble.js.map create mode 100644 Casino/js/GameEngine.js create mode 100644 Casino/js/GameEngine.js.map create mode 100644 Casino/js/GameEngineInterface.js create mode 100644 Casino/js/GameEngineInterface.js.map create mode 100644 Casino/js/GameInterface.js create mode 100644 Casino/js/GameInterface.js.map create mode 100644 Casino/js/Player.js create mode 100644 Casino/js/Player.js.map create mode 100644 Casino/js/PlayerInterface.js create mode 100644 Casino/js/PlayerInterface.js.map create mode 100644 Casino/js/Profile.js create mode 100644 Casino/js/Profile.js.map create mode 100644 Casino/tsconfig.json diff --git a/Casino/Gamble.ts b/Casino/Gamble.ts index e69de29b..7c8b5248 100644 --- a/Casino/Gamble.ts +++ b/Casino/Gamble.ts @@ -0,0 +1,3 @@ + class Gamble{ + +} \ No newline at end of file diff --git a/Casino/GameEngine.ts b/Casino/GameEngine.ts index e69de29b..99690c9d 100644 --- a/Casino/GameEngine.ts +++ b/Casino/GameEngine.ts @@ -0,0 +1,3 @@ +class GameEngine{ + +} \ No newline at end of file diff --git a/Casino/GameInterface.ts b/Casino/GameInterface.ts index e69de29b..00e82452 100644 --- a/Casino/GameInterface.ts +++ b/Casino/GameInterface.ts @@ -0,0 +1,3 @@ +interface Game{ + +} \ No newline at end of file diff --git a/Casino/Player.ts b/Casino/Player.ts index e69de29b..4ac53b07 100644 --- a/Casino/Player.ts +++ b/Casino/Player.ts @@ -0,0 +1,3 @@ +class Player{ + +} \ No newline at end of file diff --git a/Casino/PlayerInterface.ts b/Casino/PlayerInterface.ts index e69de29b..8f7d7a50 100644 --- a/Casino/PlayerInterface.ts +++ b/Casino/PlayerInterface.ts @@ -0,0 +1,5 @@ +interface PlayerInterface{ + getProfie(): string + getName(): string + getId(): number +} \ No newline at end of file diff --git a/Casino/Profile.ts b/Casino/Profile.ts index e69de29b..00b89313 100644 --- a/Casino/Profile.ts +++ b/Casino/Profile.ts @@ -0,0 +1,7 @@ +class Profile{ + id: number; + name: string; + balance: number; + + +} \ No newline at end of file diff --git a/Casino/js/Gamble.js b/Casino/js/Gamble.js new file mode 100644 index 00000000..6c14251a --- /dev/null +++ b/Casino/js/Gamble.js @@ -0,0 +1,6 @@ +var Gamble = /** @class */ (function () { + function Gamble() { + } + return Gamble; +}()); +//# sourceMappingURL=Gamble.js.map \ No newline at end of file diff --git a/Casino/js/Gamble.js.map b/Casino/js/Gamble.js.map new file mode 100644 index 00000000..89f13de0 --- /dev/null +++ b/Casino/js/Gamble.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Gamble.js","sourceRoot":"","sources":["../Gamble.ts"],"names":[],"mappings":"AAAC;IAAA;IAED,CAAC;IAAD,aAAC;AAAD,CAAC,AAFA,IAEA"} \ No newline at end of file diff --git a/Casino/js/GameEngine.js b/Casino/js/GameEngine.js new file mode 100644 index 00000000..c6aa1d17 --- /dev/null +++ b/Casino/js/GameEngine.js @@ -0,0 +1,6 @@ +var GameEngine = /** @class */ (function () { + function GameEngine() { + } + return GameEngine; +}()); +//# sourceMappingURL=GameEngine.js.map \ No newline at end of file diff --git a/Casino/js/GameEngine.js.map b/Casino/js/GameEngine.js.map new file mode 100644 index 00000000..610183a6 --- /dev/null +++ b/Casino/js/GameEngine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GameEngine.js","sourceRoot":"","sources":["../GameEngine.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,iBAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/Casino/js/GameEngineInterface.js b/Casino/js/GameEngineInterface.js new file mode 100644 index 00000000..a0a73ec2 --- /dev/null +++ b/Casino/js/GameEngineInterface.js @@ -0,0 +1 @@ +//# sourceMappingURL=GameEngineInterface.js.map \ No newline at end of file diff --git a/Casino/js/GameEngineInterface.js.map b/Casino/js/GameEngineInterface.js.map new file mode 100644 index 00000000..4aee2f2f --- /dev/null +++ b/Casino/js/GameEngineInterface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GameEngineInterface.js","sourceRoot":"","sources":["../GameEngineInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Casino/js/GameInterface.js b/Casino/js/GameInterface.js new file mode 100644 index 00000000..157d9a34 --- /dev/null +++ b/Casino/js/GameInterface.js @@ -0,0 +1 @@ +//# sourceMappingURL=GameInterface.js.map \ No newline at end of file diff --git a/Casino/js/GameInterface.js.map b/Casino/js/GameInterface.js.map new file mode 100644 index 00000000..a7949ff6 --- /dev/null +++ b/Casino/js/GameInterface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GameInterface.js","sourceRoot":"","sources":["../GameInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Casino/js/Player.js b/Casino/js/Player.js new file mode 100644 index 00000000..5ea99c51 --- /dev/null +++ b/Casino/js/Player.js @@ -0,0 +1,6 @@ +var Player = /** @class */ (function () { + function Player() { + } + return Player; +}()); +//# sourceMappingURL=Player.js.map \ No newline at end of file diff --git a/Casino/js/Player.js.map b/Casino/js/Player.js.map new file mode 100644 index 00000000..44cd0e34 --- /dev/null +++ b/Casino/js/Player.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Player.js","sourceRoot":"","sources":["../Player.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,aAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/Casino/js/PlayerInterface.js b/Casino/js/PlayerInterface.js new file mode 100644 index 00000000..efe3ade6 --- /dev/null +++ b/Casino/js/PlayerInterface.js @@ -0,0 +1 @@ +//# sourceMappingURL=PlayerInterface.js.map \ No newline at end of file diff --git a/Casino/js/PlayerInterface.js.map b/Casino/js/PlayerInterface.js.map new file mode 100644 index 00000000..b75a07d0 --- /dev/null +++ b/Casino/js/PlayerInterface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PlayerInterface.js","sourceRoot":"","sources":["../PlayerInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Casino/js/Profile.js b/Casino/js/Profile.js new file mode 100644 index 00000000..dcc603ea --- /dev/null +++ b/Casino/js/Profile.js @@ -0,0 +1,6 @@ +var Profile = /** @class */ (function () { + function Profile() { + } + return Profile; +}()); +//# sourceMappingURL=Profile.js.map \ No newline at end of file diff --git a/Casino/js/Profile.js.map b/Casino/js/Profile.js.map new file mode 100644 index 00000000..62d52e06 --- /dev/null +++ b/Casino/js/Profile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../Profile.ts"],"names":[],"mappings":"AAAA;IAAA;IAMA,CAAC;IAAD,cAAC;AAAD,CAAC,AAND,IAMC"} \ No newline at end of file diff --git a/Casino/tsconfig.json b/Casino/tsconfig.json new file mode 100644 index 00000000..a057ab17 --- /dev/null +++ b/Casino/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "noImplicitAny": false, + "outDir": "js", + "target": "es5", + "watch": true, + "module": "commonjs", + "sourceMap": true + } +} \ No newline at end of file From 0cbd40cad076042e98e0954cdb92cded7c24bd20 Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sun, 25 Mar 2018 00:38:02 -0400 Subject: [PATCH 3/8] Saving --- Casino/Craps.ts | 3 +++ Casino/GameEngineInterface.ts | 3 +++ Casino/GameInterface.ts | 2 +- Casino/Player.ts | 12 ++++++++++-- Casino/PlayerInterface.ts | 8 ++++---- Casino/Profile.ts | 12 ++++++++++++ Casino/js/Craps.js | 6 ++++++ Casino/js/Craps.js.map | 1 + Casino/js/Player.js | 17 +++++++++++++++++ Casino/js/Player.js.map | 2 +- Casino/js/Profile.js | 21 +++++++++++++++++++++ Casino/js/Profile.js.map | 2 +- 12 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 Casino/Craps.ts create mode 100644 Casino/js/Craps.js create mode 100644 Casino/js/Craps.js.map diff --git a/Casino/Craps.ts b/Casino/Craps.ts new file mode 100644 index 00000000..20fb3361 --- /dev/null +++ b/Casino/Craps.ts @@ -0,0 +1,3 @@ +class Craps{ + +} \ No newline at end of file diff --git a/Casino/GameEngineInterface.ts b/Casino/GameEngineInterface.ts index e69de29b..28e1ebb3 100644 --- a/Casino/GameEngineInterface.ts +++ b/Casino/GameEngineInterface.ts @@ -0,0 +1,3 @@ +interface GameEngineInterface{ + +} \ No newline at end of file diff --git a/Casino/GameInterface.ts b/Casino/GameInterface.ts index 00e82452..ea3ae4ba 100644 --- a/Casino/GameInterface.ts +++ b/Casino/GameInterface.ts @@ -1,3 +1,3 @@ -interface Game{ +interface GameInterface { } \ No newline at end of file diff --git a/Casino/Player.ts b/Casino/Player.ts index 4ac53b07..990dfe68 100644 --- a/Casino/Player.ts +++ b/Casino/Player.ts @@ -1,3 +1,11 @@ -class Player{ - +class Player implements PlayerInterface { + get getProfile(): Profile { + throw new Error("Method not implemented."); + } + get getName(): string { + throw new Error("Method not implemented."); + } + getId(): number { + throw new Error("Method not implemented."); + } } \ No newline at end of file diff --git a/Casino/PlayerInterface.ts b/Casino/PlayerInterface.ts index 8f7d7a50..20e176ab 100644 --- a/Casino/PlayerInterface.ts +++ b/Casino/PlayerInterface.ts @@ -1,5 +1,5 @@ interface PlayerInterface{ - getProfie(): string - getName(): string - getId(): number -} \ No newline at end of file + getProfile(): Profile; + getName(): string; + getId(): number; +} \ No newline at end of file diff --git a/Casino/Profile.ts b/Casino/Profile.ts index 00b89313..ce1885ef 100644 --- a/Casino/Profile.ts +++ b/Casino/Profile.ts @@ -3,5 +3,17 @@ class Profile{ name: string; balance: number; + get getName(){ + return this.name; + } + + get getId(){ + return this.id; + } + + get getBalance(){ + return this.balance; + } + } \ No newline at end of file diff --git a/Casino/js/Craps.js b/Casino/js/Craps.js new file mode 100644 index 00000000..5d13d341 --- /dev/null +++ b/Casino/js/Craps.js @@ -0,0 +1,6 @@ +var Craps = /** @class */ (function () { + function Craps() { + } + return Craps; +}()); +//# sourceMappingURL=Craps.js.map \ No newline at end of file diff --git a/Casino/js/Craps.js.map b/Casino/js/Craps.js.map new file mode 100644 index 00000000..3124ca49 --- /dev/null +++ b/Casino/js/Craps.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Craps.js","sourceRoot":"","sources":["../Craps.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/Casino/js/Player.js b/Casino/js/Player.js index 5ea99c51..6120c179 100644 --- a/Casino/js/Player.js +++ b/Casino/js/Player.js @@ -1,6 +1,23 @@ var Player = /** @class */ (function () { function Player() { } + Object.defineProperty(Player.prototype, "getProfile", { + get: function () { + throw new Error("Method not implemented."); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Player.prototype, "getName", { + get: function () { + throw new Error("Method not implemented."); + }, + enumerable: true, + configurable: true + }); + Player.prototype.getId = function () { + throw new Error("Method not implemented."); + }; return Player; }()); //# sourceMappingURL=Player.js.map \ No newline at end of file diff --git a/Casino/js/Player.js.map b/Casino/js/Player.js.map index 44cd0e34..814f2a6c 100644 --- a/Casino/js/Player.js.map +++ b/Casino/js/Player.js.map @@ -1 +1 @@ -{"version":3,"file":"Player.js","sourceRoot":"","sources":["../Player.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,aAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file +{"version":3,"file":"Player.js","sourceRoot":"","sources":["../Player.ts"],"names":[],"mappings":"AAAA;IAAA;IAUA,CAAC;IATE,sBAAI,8BAAU;aAAd;YACK,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;;;OAAA;IACD,sBAAI,2BAAO;aAAX;YACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;;;OAAA;IACD,sBAAK,GAAL;QACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACL,aAAC;AAAD,CAAC,AAVD,IAUC"} \ No newline at end of file diff --git a/Casino/js/Profile.js b/Casino/js/Profile.js index dcc603ea..be7bf171 100644 --- a/Casino/js/Profile.js +++ b/Casino/js/Profile.js @@ -1,6 +1,27 @@ var Profile = /** @class */ (function () { function Profile() { } + Object.defineProperty(Profile.prototype, "getName", { + get: function () { + return this.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "getId", { + get: function () { + return this.id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "getBalance", { + get: function () { + return this.balance; + }, + enumerable: true, + configurable: true + }); return Profile; }()); //# sourceMappingURL=Profile.js.map \ No newline at end of file diff --git a/Casino/js/Profile.js.map b/Casino/js/Profile.js.map index 62d52e06..475f27b7 100644 --- a/Casino/js/Profile.js.map +++ b/Casino/js/Profile.js.map @@ -1 +1 @@ -{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../Profile.ts"],"names":[],"mappings":"AAAA;IAAA;IAMA,CAAC;IAAD,cAAC;AAAD,CAAC,AAND,IAMC"} \ No newline at end of file +{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../Profile.ts"],"names":[],"mappings":"AAAA;IAAA;IAkBA,CAAC;IAbG,sBAAI,4BAAO;aAAX;YACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,0BAAK;aAAT;YACI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,CAAC;;;OAAA;IAED,sBAAI,+BAAU;aAAd;YACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAGL,cAAC;AAAD,CAAC,AAlBD,IAkBC"} \ No newline at end of file From e4eabd95cf769c01d093578532cb28d67e1f961f Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sun, 25 Mar 2018 15:18:00 -0400 Subject: [PATCH 4/8] Moved things around --- Casino/Craps.ts | 3 -- Casino/CrapsGame.ts | 34 +++++++++++++++ Casino/Gamble.ts | 2 +- Casino/GameInterface.ts | 2 +- Casino/MainMenu.ts | 26 ++++++++++++ Casino/Player.ts | 20 ++++++--- Casino/Profile.ts | 28 ++++++++++-- Casino/UI.ts | 28 ++++++++++++ Casino/app.ts | 9 ++++ Casino/js/Craps.js | 6 --- Casino/js/Craps.js.map | 1 - Casino/js/Gamble.js.map | 1 - Casino/js/GameEngine.js.map | 1 - Casino/js/GameEngineInterface.js.map | 1 - Casino/js/Player.js | 23 ---------- Casino/js/Player.js.map | 1 - Casino/js/Profile.js | 27 ------------ Casino/js/Profile.js.map | 1 - js/CrapsGame.js | 27 ++++++++++++ js/CrapsGame.js.map | 1 + {Casino/js => js}/Gamble.js | 0 js/Gamble.js.map | 1 + {Casino/js => js}/GameEngine.js | 0 js/GameEngine.js.map | 1 + {Casino/js => js}/GameEngineInterface.js | 0 js/GameEngineInterface.js.map | 1 + {Casino/js => js}/GameInterface.js | 0 {Casino/js => js}/GameInterface.js.map | 2 +- js/MainMenu.js | 23 ++++++++++ js/MainMenu.js.map | 1 + js/Player.js | 19 +++++++++ js/Player.js.map | 1 + {Casino/js => js}/PlayerInterface.js | 0 {Casino/js => js}/PlayerInterface.js.map | 2 +- js/Profile.js | 54 ++++++++++++++++++++++++ js/Profile.js.map | 1 + js/UI.js | 31 ++++++++++++++ js/UI.js.map | 1 + js/app.js | 12 ++++++ js/app.js.map | 1 + Casino/tsconfig.json => tsconfig.json | 0 41 files changed, 316 insertions(+), 77 deletions(-) delete mode 100644 Casino/Craps.ts create mode 100644 Casino/CrapsGame.ts create mode 100644 Casino/MainMenu.ts create mode 100644 Casino/UI.ts create mode 100644 Casino/app.ts delete mode 100644 Casino/js/Craps.js delete mode 100644 Casino/js/Craps.js.map delete mode 100644 Casino/js/Gamble.js.map delete mode 100644 Casino/js/GameEngine.js.map delete mode 100644 Casino/js/GameEngineInterface.js.map delete mode 100644 Casino/js/Player.js delete mode 100644 Casino/js/Player.js.map delete mode 100644 Casino/js/Profile.js delete mode 100644 Casino/js/Profile.js.map create mode 100644 js/CrapsGame.js create mode 100644 js/CrapsGame.js.map rename {Casino/js => js}/Gamble.js (100%) create mode 100644 js/Gamble.js.map rename {Casino/js => js}/GameEngine.js (100%) create mode 100644 js/GameEngine.js.map rename {Casino/js => js}/GameEngineInterface.js (100%) create mode 100644 js/GameEngineInterface.js.map rename {Casino/js => js}/GameInterface.js (100%) rename {Casino/js => js}/GameInterface.js.map (52%) create mode 100644 js/MainMenu.js create mode 100644 js/MainMenu.js.map create mode 100644 js/Player.js create mode 100644 js/Player.js.map rename {Casino/js => js}/PlayerInterface.js (100%) rename {Casino/js => js}/PlayerInterface.js.map (51%) create mode 100644 js/Profile.js create mode 100644 js/Profile.js.map create mode 100644 js/UI.js create mode 100644 js/UI.js.map create mode 100644 js/app.js create mode 100644 js/app.js.map rename Casino/tsconfig.json => tsconfig.json (100%) diff --git a/Casino/Craps.ts b/Casino/Craps.ts deleted file mode 100644 index 20fb3361..00000000 --- a/Casino/Craps.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Craps{ - -} \ No newline at end of file diff --git a/Casino/CrapsGame.ts b/Casino/CrapsGame.ts new file mode 100644 index 00000000..b040a35f --- /dev/null +++ b/Casino/CrapsGame.ts @@ -0,0 +1,34 @@ +class Craps{ + + crapsPlayer: Player; + betAmount: number = 0; + betUserPlaces: any = 0; + + constructor(player: Player){ + this.crapsPlayer = player; + } + + userPlacesBet(){ + document.write("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + // event handler here for the bet type + // set user bet places to the input + UI.clearScreen(); + } + + userBetAmount(){ + document.write("Please enter your bet amount down below"); + if(this.betAmount > this.crapsPlayer.getBalance()){ + UI.display("You can't bet that much!"); + } else{ + + } + //event handler here for bet amount + UI.clearScreen(); + } + startGame(){ + + } + } + + + diff --git a/Casino/Gamble.ts b/Casino/Gamble.ts index 7c8b5248..a31e46ed 100644 --- a/Casino/Gamble.ts +++ b/Casino/Gamble.ts @@ -1,3 +1,3 @@ class Gamble{ - + } \ No newline at end of file diff --git a/Casino/GameInterface.ts b/Casino/GameInterface.ts index ea3ae4ba..a62a4b93 100644 --- a/Casino/GameInterface.ts +++ b/Casino/GameInterface.ts @@ -1,3 +1,3 @@ interface GameInterface { - + //hjf } \ No newline at end of file diff --git a/Casino/MainMenu.ts b/Casino/MainMenu.ts new file mode 100644 index 00000000..d9073fcf --- /dev/null +++ b/Casino/MainMenu.ts @@ -0,0 +1,26 @@ +class MainMenu{ + mainPlayer: Player; + newCrapsGame = new Craps(this.mainPlayer); + constructor(){ + this.chooseGame = this.chooseGame.bind(this); + } + + start() { + UI.display("What game do you want to play?"); + UI.display("Craps or Craps?"); + UI.submitButton.addEventListener("click", this.chooseGame); + } + + chooseGame(): void { + UI.submitButton.removeEventListener("click", this.chooseGame); + if (UI.lastInput === "Craps") { + this.newCrapsGame.startGame(); + + } else { + UI.display("Too bad you're playing Craps!"); + this.newCrapsGame.startGame(); + } + } + + +} \ No newline at end of file diff --git a/Casino/Player.ts b/Casino/Player.ts index 990dfe68..d279a024 100644 --- a/Casino/Player.ts +++ b/Casino/Player.ts @@ -1,11 +1,21 @@ class Player implements PlayerInterface { - get getProfile(): Profile { - throw new Error("Method not implemented."); + + private playerProfile: Profile; + + constructor(profile: Profile){ + this.playerProfile = profile; } - get getName(): string { - throw new Error("Method not implemented."); + getProfile(): Profile { + return this.playerProfile; + } + getName(): string { + return this.playerProfile.getName; } getId(): number { - throw new Error("Method not implemented."); + return this.playerProfile.getId; + } + + getBalance(): number{ + return this.playerProfile.getBalance; } } \ No newline at end of file diff --git a/Casino/Profile.ts b/Casino/Profile.ts index ce1885ef..71f627ae 100644 --- a/Casino/Profile.ts +++ b/Casino/Profile.ts @@ -1,8 +1,15 @@ class Profile{ - id: number; - name: string; - balance: number; + private id: number; + private name: string; + private balance: number; + public listOfProfiles: Profile[]; + + constructor(id, name, balance){ + this.id = id; + this.name = name; + this.balance = balance; + } get getName(){ return this.name; } @@ -15,5 +22,20 @@ class Profile{ return this.balance; } + set setId(id){ + this.id = id; + } + + set setName(name){ + this.name = name; + } + + set setBalance(balance){ + this.balance = balance; + } + + public addProfile(profile: Profile): void{ + this.listOfProfiles.push(profile); + } } \ No newline at end of file diff --git a/Casino/UI.ts b/Casino/UI.ts new file mode 100644 index 00000000..be0c6762 --- /dev/null +++ b/Casino/UI.ts @@ -0,0 +1,28 @@ +class UI{ +static userInput = document.getElementById("user_input"); + static window = document.getElementById('display'); + static submitButton = document.getElementById('submit'); + static _lastInput: any; + private static _instance: UI; + + private constructor() { + UI.submitButton.addEventListener("click", (e: Event) => { UI._lastInput = UI.userInput.value }); + UI.submitButton.addEventListener("click", (e: Event) => { UI.userInput.value = '' }); + } + + static display(input: string): void { + this.window.innerText += input + '\n'; + } + + static clearScreen(): void { + this.window.innerText = ''; + } + + public static get Instance(): UI { + return this._instance || (this._instance = new UI()); + } + + public static get lastInput(): any { + return this._lastInput; + } +} \ No newline at end of file diff --git a/Casino/app.ts b/Casino/app.ts new file mode 100644 index 00000000..fc884c3b --- /dev/null +++ b/Casino/app.ts @@ -0,0 +1,9 @@ +class App{ + mainMenu = new MainMenu(); + startCasino(){ + UI.Instance; + this.mainMenu.start(); + } + +} +this.app.startCasino(); diff --git a/Casino/js/Craps.js b/Casino/js/Craps.js deleted file mode 100644 index 5d13d341..00000000 --- a/Casino/js/Craps.js +++ /dev/null @@ -1,6 +0,0 @@ -var Craps = /** @class */ (function () { - function Craps() { - } - return Craps; -}()); -//# sourceMappingURL=Craps.js.map \ No newline at end of file diff --git a/Casino/js/Craps.js.map b/Casino/js/Craps.js.map deleted file mode 100644 index 3124ca49..00000000 --- a/Casino/js/Craps.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Craps.js","sourceRoot":"","sources":["../Craps.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/Casino/js/Gamble.js.map b/Casino/js/Gamble.js.map deleted file mode 100644 index 89f13de0..00000000 --- a/Casino/js/Gamble.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Gamble.js","sourceRoot":"","sources":["../Gamble.ts"],"names":[],"mappings":"AAAC;IAAA;IAED,CAAC;IAAD,aAAC;AAAD,CAAC,AAFA,IAEA"} \ No newline at end of file diff --git a/Casino/js/GameEngine.js.map b/Casino/js/GameEngine.js.map deleted file mode 100644 index 610183a6..00000000 --- a/Casino/js/GameEngine.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GameEngine.js","sourceRoot":"","sources":["../GameEngine.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,iBAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/Casino/js/GameEngineInterface.js.map b/Casino/js/GameEngineInterface.js.map deleted file mode 100644 index 4aee2f2f..00000000 --- a/Casino/js/GameEngineInterface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GameEngineInterface.js","sourceRoot":"","sources":["../GameEngineInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Casino/js/Player.js b/Casino/js/Player.js deleted file mode 100644 index 6120c179..00000000 --- a/Casino/js/Player.js +++ /dev/null @@ -1,23 +0,0 @@ -var Player = /** @class */ (function () { - function Player() { - } - Object.defineProperty(Player.prototype, "getProfile", { - get: function () { - throw new Error("Method not implemented."); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Player.prototype, "getName", { - get: function () { - throw new Error("Method not implemented."); - }, - enumerable: true, - configurable: true - }); - Player.prototype.getId = function () { - throw new Error("Method not implemented."); - }; - return Player; -}()); -//# sourceMappingURL=Player.js.map \ No newline at end of file diff --git a/Casino/js/Player.js.map b/Casino/js/Player.js.map deleted file mode 100644 index 814f2a6c..00000000 --- a/Casino/js/Player.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Player.js","sourceRoot":"","sources":["../Player.ts"],"names":[],"mappings":"AAAA;IAAA;IAUA,CAAC;IATE,sBAAI,8BAAU;aAAd;YACK,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;;;OAAA;IACD,sBAAI,2BAAO;aAAX;YACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;;;OAAA;IACD,sBAAK,GAAL;QACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACL,aAAC;AAAD,CAAC,AAVD,IAUC"} \ No newline at end of file diff --git a/Casino/js/Profile.js b/Casino/js/Profile.js deleted file mode 100644 index be7bf171..00000000 --- a/Casino/js/Profile.js +++ /dev/null @@ -1,27 +0,0 @@ -var Profile = /** @class */ (function () { - function Profile() { - } - Object.defineProperty(Profile.prototype, "getName", { - get: function () { - return this.name; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "getId", { - get: function () { - return this.id; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "getBalance", { - get: function () { - return this.balance; - }, - enumerable: true, - configurable: true - }); - return Profile; -}()); -//# sourceMappingURL=Profile.js.map \ No newline at end of file diff --git a/Casino/js/Profile.js.map b/Casino/js/Profile.js.map deleted file mode 100644 index 475f27b7..00000000 --- a/Casino/js/Profile.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../Profile.ts"],"names":[],"mappings":"AAAA;IAAA;IAkBA,CAAC;IAbG,sBAAI,4BAAO;aAAX;YACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,0BAAK;aAAT;YACI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,CAAC;;;OAAA;IAED,sBAAI,+BAAU;aAAd;YACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAGL,cAAC;AAAD,CAAC,AAlBD,IAkBC"} \ No newline at end of file diff --git a/js/CrapsGame.js b/js/CrapsGame.js new file mode 100644 index 00000000..bb4f0122 --- /dev/null +++ b/js/CrapsGame.js @@ -0,0 +1,27 @@ +var Craps = /** @class */ (function () { + function Craps(player) { + this.betAmount = 0; + this.betUserPlaces = 0; + this.crapsPlayer = player; + } + Craps.prototype.userPlacesBet = function () { + document.write("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + // event handler here for the bet type + // set user bet places to the input + UI.clearScreen(); + }; + Craps.prototype.userBetAmount = function () { + document.write("Please enter your bet amount down below"); + if (this.betAmount > this.crapsPlayer.getBalance()) { + UI.display("You can't bet that much!"); + } + else { + } + //event handler here for bet amount + UI.clearScreen(); + }; + Craps.prototype.startGame = function () { + }; + return Craps; +}()); +//# sourceMappingURL=CrapsGame.js.map \ No newline at end of file diff --git a/js/CrapsGame.js.map b/js/CrapsGame.js.map new file mode 100644 index 00000000..9c2eb429 --- /dev/null +++ b/js/CrapsGame.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CrapsGame.js","sourceRoot":"","sources":["../Casino/CrapsGame.ts"],"names":[],"mappings":"AAAA;IAMI,eAAY,MAAc;QAH1B,cAAS,GAAW,CAAC,CAAC;QACtB,kBAAa,GAAQ,CAAC,CAAC;QAGnB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED,6BAAa,GAAb;QACI,QAAQ,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;QACzF,sCAAsC;QACtC,mCAAmC;QACnC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,6BAAa,GAAb;QACI,QAAQ,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC1D,EAAE,CAAA,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAA,CAAC;YAC3C,EAAE,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAC/C,CAAC;QAAC,IAAI,CAAA,CAAC;QAEP,CAAC;QACD,mCAAmC;QACnC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IACD,yBAAS,GAAT;IAEA,CAAC;IACJ,YAAC;AAAD,CAAC,AA9BF,IA8BE"} \ No newline at end of file diff --git a/Casino/js/Gamble.js b/js/Gamble.js similarity index 100% rename from Casino/js/Gamble.js rename to js/Gamble.js diff --git a/js/Gamble.js.map b/js/Gamble.js.map new file mode 100644 index 00000000..c8603225 --- /dev/null +++ b/js/Gamble.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Gamble.js","sourceRoot":"","sources":["../Casino/Gamble.ts"],"names":[],"mappings":"AAAC;IAAA;IAED,CAAC;IAAD,aAAC;AAAD,CAAC,AAFA,IAEA"} \ No newline at end of file diff --git a/Casino/js/GameEngine.js b/js/GameEngine.js similarity index 100% rename from Casino/js/GameEngine.js rename to js/GameEngine.js diff --git a/js/GameEngine.js.map b/js/GameEngine.js.map new file mode 100644 index 00000000..923d3518 --- /dev/null +++ b/js/GameEngine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GameEngine.js","sourceRoot":"","sources":["../Casino/GameEngine.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,iBAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/Casino/js/GameEngineInterface.js b/js/GameEngineInterface.js similarity index 100% rename from Casino/js/GameEngineInterface.js rename to js/GameEngineInterface.js diff --git a/js/GameEngineInterface.js.map b/js/GameEngineInterface.js.map new file mode 100644 index 00000000..e05535e4 --- /dev/null +++ b/js/GameEngineInterface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GameEngineInterface.js","sourceRoot":"","sources":["../Casino/GameEngineInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Casino/js/GameInterface.js b/js/GameInterface.js similarity index 100% rename from Casino/js/GameInterface.js rename to js/GameInterface.js diff --git a/Casino/js/GameInterface.js.map b/js/GameInterface.js.map similarity index 52% rename from Casino/js/GameInterface.js.map rename to js/GameInterface.js.map index a7949ff6..6cfa9ae3 100644 --- a/Casino/js/GameInterface.js.map +++ b/js/GameInterface.js.map @@ -1 +1 @@ -{"version":3,"file":"GameInterface.js","sourceRoot":"","sources":["../GameInterface.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"GameInterface.js","sourceRoot":"","sources":["../Casino/GameInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/MainMenu.js b/js/MainMenu.js new file mode 100644 index 00000000..ccf62e13 --- /dev/null +++ b/js/MainMenu.js @@ -0,0 +1,23 @@ +var MainMenu = /** @class */ (function () { + function MainMenu() { + this.newCrapsGame = new Craps(this.mainPlayer); + this.chooseGame = this.chooseGame.bind(this); + } + MainMenu.prototype.start = function () { + UI.display("What game do you want to play?"); + UI.display("Craps or Craps?"); + UI.submitButton.addEventListener("click", this.chooseGame); + }; + MainMenu.prototype.chooseGame = function () { + UI.submitButton.removeEventListener("click", this.chooseGame); + if (UI.lastInput === "Craps") { + this.newCrapsGame.startGame(); + } + else { + UI.display("Too bad you're playing Craps!"); + this.newCrapsGame.startGame(); + } + }; + return MainMenu; +}()); +//# sourceMappingURL=MainMenu.js.map \ No newline at end of file diff --git a/js/MainMenu.js.map b/js/MainMenu.js.map new file mode 100644 index 00000000..d2a16c7e --- /dev/null +++ b/js/MainMenu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MainMenu.js","sourceRoot":"","sources":["../Casino/MainMenu.ts"],"names":[],"mappings":"AAAA;IAGI;QADA,iBAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEtC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,wBAAK,GAAL;QACI,EAAE,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;QAC7C,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC9B,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IAEA,6BAAU,GAAV;QACG,EAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;QAEjC,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;YAC5C,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;QAClC,CAAC;IACL,CAAC;IAGL,eAAC;AAAD,CAAC,AAzBD,IAyBC"} \ No newline at end of file diff --git a/js/Player.js b/js/Player.js new file mode 100644 index 00000000..8c99c104 --- /dev/null +++ b/js/Player.js @@ -0,0 +1,19 @@ +var Player = /** @class */ (function () { + function Player(profile) { + this.playerProfile = profile; + } + Player.prototype.getProfile = function () { + return this.playerProfile; + }; + Player.prototype.getName = function () { + return this.playerProfile.getName; + }; + Player.prototype.getId = function () { + return this.playerProfile.getId; + }; + Player.prototype.getBalance = function () { + return this.playerProfile.getBalance; + }; + return Player; +}()); +//# sourceMappingURL=Player.js.map \ No newline at end of file diff --git a/js/Player.js.map b/js/Player.js.map new file mode 100644 index 00000000..cf868bfb --- /dev/null +++ b/js/Player.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Player.js","sourceRoot":"","sources":["../Casino/Player.ts"],"names":[],"mappings":"AAAA;IAII,gBAAY,OAAgB;QACxB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IACjC,CAAC;IACD,2BAAU,GAAV;QACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IACD,wBAAO,GAAP;QACG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;IACrC,CAAC;IACD,sBAAK,GAAL;QACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,2BAAU,GAAV;QACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;IACzC,CAAC;IACL,aAAC;AAAD,CAAC,AApBD,IAoBC"} \ No newline at end of file diff --git a/Casino/js/PlayerInterface.js b/js/PlayerInterface.js similarity index 100% rename from Casino/js/PlayerInterface.js rename to js/PlayerInterface.js diff --git a/Casino/js/PlayerInterface.js.map b/js/PlayerInterface.js.map similarity index 51% rename from Casino/js/PlayerInterface.js.map rename to js/PlayerInterface.js.map index b75a07d0..3f899bd7 100644 --- a/Casino/js/PlayerInterface.js.map +++ b/js/PlayerInterface.js.map @@ -1 +1 @@ -{"version":3,"file":"PlayerInterface.js","sourceRoot":"","sources":["../PlayerInterface.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"PlayerInterface.js","sourceRoot":"","sources":["../Casino/PlayerInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/Profile.js b/js/Profile.js new file mode 100644 index 00000000..8b84ea51 --- /dev/null +++ b/js/Profile.js @@ -0,0 +1,54 @@ +var Profile = /** @class */ (function () { + function Profile(id, name, balance) { + this.id = id; + this.name = name; + this.balance = balance; + } + Object.defineProperty(Profile.prototype, "getName", { + get: function () { + return this.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "getId", { + get: function () { + return this.id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "getBalance", { + get: function () { + return this.balance; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "setId", { + set: function (id) { + this.id = id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "setName", { + set: function (name) { + this.name = name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "setBalance", { + set: function (balance) { + this.balance = balance; + }, + enumerable: true, + configurable: true + }); + Profile.prototype.addProfile = function (profile) { + this.listOfProfiles.push(profile); + }; + return Profile; +}()); +//# sourceMappingURL=Profile.js.map \ No newline at end of file diff --git a/js/Profile.js.map b/js/Profile.js.map new file mode 100644 index 00000000..384b8ba8 --- /dev/null +++ b/js/Profile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../Casino/Profile.ts"],"names":[],"mappings":"AAAA;IAOI,iBAAY,EAAE,EAAE,IAAI,EAAE,OAAO;QACzB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IACD,sBAAI,4BAAO;aAAX;YACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,0BAAK;aAAT;YACI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,CAAC;;;OAAA;IAED,sBAAI,+BAAU;aAAd;YACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAED,sBAAI,0BAAK;aAAT,UAAU,EAAE;YACR,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,CAAC;;;OAAA;IAED,sBAAI,4BAAO;aAAX,UAAY,IAAI;YACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,+BAAU;aAAd,UAAe,OAAO;YAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;;;OAAA;IAEM,4BAAU,GAAjB,UAAkB,OAAgB;QAC9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEL,cAAC;AAAD,CAAC,AAxCD,IAwCC"} \ No newline at end of file diff --git a/js/UI.js b/js/UI.js new file mode 100644 index 00000000..361e1b74 --- /dev/null +++ b/js/UI.js @@ -0,0 +1,31 @@ +var UI = /** @class */ (function () { + function UI() { + UI.submitButton.addEventListener("click", function (e) { UI._lastInput = UI.userInput.value; }); + UI.submitButton.addEventListener("click", function (e) { UI.userInput.value = ''; }); + } + UI.display = function (input) { + this.window.innerText += input + '\n'; + }; + UI.clearScreen = function () { + this.window.innerText = ''; + }; + Object.defineProperty(UI, "Instance", { + get: function () { + return this._instance || (this._instance = new UI()); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UI, "lastInput", { + get: function () { + return this._lastInput; + }, + enumerable: true, + configurable: true + }); + UI.userInput = document.getElementById("user_input"); + UI.window = document.getElementById('display'); + UI.submitButton = document.getElementById('submit'); + return UI; +}()); +//# sourceMappingURL=UI.js.map \ No newline at end of file diff --git a/js/UI.js.map b/js/UI.js.map new file mode 100644 index 00000000..d34893f6 --- /dev/null +++ b/js/UI.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UI.js","sourceRoot":"","sources":["../Casino/UI.ts"],"names":[],"mappings":"AAAA;IAOI;QACI,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAO,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC;QAChG,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAO,EAAE,CAAC,SAAS,CAAC,KAAK,GAAG,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;IAEM,UAAO,GAAd,UAAe,KAAa;QACxB,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,GAAG,IAAI,CAAC;IAC1C,CAAC;IAEM,cAAW,GAAlB;QACI,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;IAC/B,CAAC;IAED,sBAAkB,cAAQ;aAA1B;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;QACzD,CAAC;;;OAAA;IAED,sBAAkB,eAAS;aAA3B;YACI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC3B,CAAC;;;OAAA;IAzBE,YAAS,GAAqB,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAChE,SAAM,GAAmB,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5D,eAAY,GAAmB,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAwB5E,SAAC;CAAA,AA3BD,IA2BC"} \ No newline at end of file diff --git a/js/app.js b/js/app.js new file mode 100644 index 00000000..3ab2de54 --- /dev/null +++ b/js/app.js @@ -0,0 +1,12 @@ +var App = /** @class */ (function () { + function App() { + this.mainMenu = new MainMenu(); + } + App.prototype.startCasino = function () { + UI.Instance; + this.mainMenu.start(); + }; + return App; +}()); +this.app.startCasino(); +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/js/app.js.map b/js/app.js.map new file mode 100644 index 00000000..e9641dd1 --- /dev/null +++ b/js/app.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.js","sourceRoot":"","sources":["../Casino/app.ts"],"names":[],"mappings":"AAAA;IAAA;QACI,aAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAM9B,CAAC;IALE,yBAAW,GAAX;QACK,EAAE,CAAC,QAAQ,CAAC;QACZ,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAEL,UAAC;AAAD,CAAC,AAPD,IAOC;AACD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/Casino/tsconfig.json b/tsconfig.json similarity index 100% rename from Casino/tsconfig.json rename to tsconfig.json From 18d8712047c48ebf6aa557242b36b636c53213d4 Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sun, 25 Mar 2018 16:25:35 -0400 Subject: [PATCH 5/8] Moved more stuff around --- Casino/CrapsGame.ts | 34 -------- Casino/MainMenu.ts | 26 ------ Casino/Player.ts | 21 ----- Casino/PlayerInterface.ts | 5 -- Casino/Profile.ts | 41 --------- Casino/UI.ts | 28 ------ Casino/app.ts | 177 ++++++++++++++++++++++++++++++++++++-- index.html | 6 +- js/CrapsGame.js | 27 ------ js/CrapsGame.js.map | 1 - js/GameInterface.js.map | 1 - js/MainMenu.js | 23 ----- js/MainMenu.js.map | 1 - js/Player.js | 19 ---- js/Player.js.map | 1 - js/PlayerInterface.js | 1 - js/PlayerInterface.js.map | 1 - js/Profile.js | 54 ------------ js/Profile.js.map | 1 - js/UI.js | 31 ------- js/UI.js.map | 1 - js/app.js | 166 +++++++++++++++++++++++++++++++++-- js/app.js.map | 2 +- 23 files changed, 336 insertions(+), 332 deletions(-) delete mode 100644 Casino/CrapsGame.ts delete mode 100644 Casino/MainMenu.ts delete mode 100644 Casino/Player.ts delete mode 100644 Casino/PlayerInterface.ts delete mode 100644 Casino/Profile.ts delete mode 100644 Casino/UI.ts delete mode 100644 js/CrapsGame.js delete mode 100644 js/CrapsGame.js.map delete mode 100644 js/GameInterface.js.map delete mode 100644 js/MainMenu.js delete mode 100644 js/MainMenu.js.map delete mode 100644 js/Player.js delete mode 100644 js/Player.js.map delete mode 100644 js/PlayerInterface.js delete mode 100644 js/PlayerInterface.js.map delete mode 100644 js/Profile.js delete mode 100644 js/Profile.js.map delete mode 100644 js/UI.js delete mode 100644 js/UI.js.map diff --git a/Casino/CrapsGame.ts b/Casino/CrapsGame.ts deleted file mode 100644 index b040a35f..00000000 --- a/Casino/CrapsGame.ts +++ /dev/null @@ -1,34 +0,0 @@ -class Craps{ - - crapsPlayer: Player; - betAmount: number = 0; - betUserPlaces: any = 0; - - constructor(player: Player){ - this.crapsPlayer = player; - } - - userPlacesBet(){ - document.write("Hello!, please enter in Pass Line or Don't pass line for you bet below"); - // event handler here for the bet type - // set user bet places to the input - UI.clearScreen(); - } - - userBetAmount(){ - document.write("Please enter your bet amount down below"); - if(this.betAmount > this.crapsPlayer.getBalance()){ - UI.display("You can't bet that much!"); - } else{ - - } - //event handler here for bet amount - UI.clearScreen(); - } - startGame(){ - - } - } - - - diff --git a/Casino/MainMenu.ts b/Casino/MainMenu.ts deleted file mode 100644 index d9073fcf..00000000 --- a/Casino/MainMenu.ts +++ /dev/null @@ -1,26 +0,0 @@ -class MainMenu{ - mainPlayer: Player; - newCrapsGame = new Craps(this.mainPlayer); - constructor(){ - this.chooseGame = this.chooseGame.bind(this); - } - - start() { - UI.display("What game do you want to play?"); - UI.display("Craps or Craps?"); - UI.submitButton.addEventListener("click", this.chooseGame); - } - - chooseGame(): void { - UI.submitButton.removeEventListener("click", this.chooseGame); - if (UI.lastInput === "Craps") { - this.newCrapsGame.startGame(); - - } else { - UI.display("Too bad you're playing Craps!"); - this.newCrapsGame.startGame(); - } - } - - -} \ No newline at end of file diff --git a/Casino/Player.ts b/Casino/Player.ts deleted file mode 100644 index d279a024..00000000 --- a/Casino/Player.ts +++ /dev/null @@ -1,21 +0,0 @@ -class Player implements PlayerInterface { - - private playerProfile: Profile; - - constructor(profile: Profile){ - this.playerProfile = profile; - } - getProfile(): Profile { - return this.playerProfile; - } - getName(): string { - return this.playerProfile.getName; - } - getId(): number { - return this.playerProfile.getId; - } - - getBalance(): number{ - return this.playerProfile.getBalance; - } -} \ No newline at end of file diff --git a/Casino/PlayerInterface.ts b/Casino/PlayerInterface.ts deleted file mode 100644 index 20e176ab..00000000 --- a/Casino/PlayerInterface.ts +++ /dev/null @@ -1,5 +0,0 @@ -interface PlayerInterface{ - getProfile(): Profile; - getName(): string; - getId(): number; -} \ No newline at end of file diff --git a/Casino/Profile.ts b/Casino/Profile.ts deleted file mode 100644 index 71f627ae..00000000 --- a/Casino/Profile.ts +++ /dev/null @@ -1,41 +0,0 @@ -class Profile{ - private id: number; - private name: string; - private balance: number; - - public listOfProfiles: Profile[]; - - constructor(id, name, balance){ - this.id = id; - this.name = name; - this.balance = balance; - } - get getName(){ - return this.name; - } - - get getId(){ - return this.id; - } - - get getBalance(){ - return this.balance; - } - - set setId(id){ - this.id = id; - } - - set setName(name){ - this.name = name; - } - - set setBalance(balance){ - this.balance = balance; - } - - public addProfile(profile: Profile): void{ - this.listOfProfiles.push(profile); - } - -} \ No newline at end of file diff --git a/Casino/UI.ts b/Casino/UI.ts deleted file mode 100644 index be0c6762..00000000 --- a/Casino/UI.ts +++ /dev/null @@ -1,28 +0,0 @@ -class UI{ -static userInput = document.getElementById("user_input"); - static window = document.getElementById('display'); - static submitButton = document.getElementById('submit'); - static _lastInput: any; - private static _instance: UI; - - private constructor() { - UI.submitButton.addEventListener("click", (e: Event) => { UI._lastInput = UI.userInput.value }); - UI.submitButton.addEventListener("click", (e: Event) => { UI.userInput.value = '' }); - } - - static display(input: string): void { - this.window.innerText += input + '\n'; - } - - static clearScreen(): void { - this.window.innerText = ''; - } - - public static get Instance(): UI { - return this._instance || (this._instance = new UI()); - } - - public static get lastInput(): any { - return this._lastInput; - } -} \ No newline at end of file diff --git a/Casino/app.ts b/Casino/app.ts index fc884c3b..f3cc3754 100644 --- a/Casino/app.ts +++ b/Casino/app.ts @@ -1,9 +1,174 @@ -class App{ - mainMenu = new MainMenu(); - startCasino(){ - UI.Instance; - this.mainMenu.start(); +class App { + newMainMenu = new MainMenu; + public static main(): void{ + + } +} +class UI{ + static userInput = document.getElementById("user_input"); + static window = document.getElementById('display'); + static submitButton = document.getElementById('submit'); + static _lastInput: any; + private static _instance: UI; + + private constructor() { + UI.submitButton.addEventListener("click", (e: Event) => { UI._lastInput = UI.userInput.value }); + UI.submitButton.addEventListener("click", (e: Event) => { UI.userInput.value = '' }); + } + + static display(input: string): void { + this.window.innerText += input + '\n'; + } + + static clearScreen(): void { + this.window.innerText = ''; + } + + public static get Instance(): UI { + return this._instance || (this._instance = new UI()); + } + + public static get lastInput(): any { + return this._lastInput; + } +} + +class Craps{ + + crapsPlayer: Player; + betAmount: number = 0; + betUserPlaces: any = 0; + + constructor(player: Player){ + this.crapsPlayer = player; + } + + userPlacesBet(){ + UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + // event handler here for the bet type + // set user bet places to the input + + UI.clearScreen(); + } + + userBetAmount(){ + UI.display("Please enter your bet amount down below"); + if(this.betAmount > this.crapsPlayer.getBalance()){ + UI.display("You can't bet that much!"); + } else{ + //event handler here for bet amount + } + UI.clearScreen(); + } + + startGame(){ + + } +} + +class Dice{ + sides = 6; + rollDice(){ + } +} + +class MainMenu{ + mainPlayer: Player; + newCrapsGame = new Craps(this.mainPlayer); + constructor(){ + this.chooseGame = this.chooseGame.bind(this); + } + + start() { + UI.display("What game do you want to play?"); + UI.display("Craps or Craps?"); + UI.submitButton.addEventListener("click", this.chooseGame); + } + + chooseGame(): void { + UI.submitButton.removeEventListener("click", this.chooseGame); + if (UI.lastInput === "Craps") { + this.newCrapsGame.startGame(); + + } else { + UI.display("Too bad you're playing Craps!"); + this.newCrapsGame.startGame(); + } + } + + +} + +class Player implements PlayerInterface { + private playerProfile: Profile; + + constructor(profile: Profile){ + this.playerProfile = profile; + } + getProfile(): Profile { + return this.playerProfile; + } + getName(): string { + return this.playerProfile.getName; + } + getId(): number { + return this.playerProfile.getId; + } + + getBalance(): number{ + return this.playerProfile.getBalance; + } +} + +interface PlayerInterface{ + getProfile(): Profile; + getName(): string; + getId(): number; +} + +class Profile{ + private id: number; + private name: string; + private balance: number; + + public listOfProfiles: Profile[]; + + constructor(id, name, balance){ + this.id = id; + this.name = name; + this.balance = balance; + } + get getName(){ + return this.name; + } + + get getId(){ + return this.id; + } + + get getBalance(){ + return this.balance; + } + + set setId(id){ + this.id = id; + } + + set setName(name){ + this.name = name; + } + + set setBalance(balance){ + this.balance = balance; + } + + public addProfile(profile: Profile): void{ + this.listOfProfiles.push(profile); + } + } -this.app.startCasino(); + +const instance = UI.Instance; +App.main(); diff --git a/index.html b/index.html index d2c3c254..c9756993 100644 --- a/index.html +++ b/index.html @@ -22,10 +22,10 @@

TypeScript Casino

- +
- - + + diff --git a/js/CrapsGame.js b/js/CrapsGame.js deleted file mode 100644 index bb4f0122..00000000 --- a/js/CrapsGame.js +++ /dev/null @@ -1,27 +0,0 @@ -var Craps = /** @class */ (function () { - function Craps(player) { - this.betAmount = 0; - this.betUserPlaces = 0; - this.crapsPlayer = player; - } - Craps.prototype.userPlacesBet = function () { - document.write("Hello!, please enter in Pass Line or Don't pass line for you bet below"); - // event handler here for the bet type - // set user bet places to the input - UI.clearScreen(); - }; - Craps.prototype.userBetAmount = function () { - document.write("Please enter your bet amount down below"); - if (this.betAmount > this.crapsPlayer.getBalance()) { - UI.display("You can't bet that much!"); - } - else { - } - //event handler here for bet amount - UI.clearScreen(); - }; - Craps.prototype.startGame = function () { - }; - return Craps; -}()); -//# sourceMappingURL=CrapsGame.js.map \ No newline at end of file diff --git a/js/CrapsGame.js.map b/js/CrapsGame.js.map deleted file mode 100644 index 9c2eb429..00000000 --- a/js/CrapsGame.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CrapsGame.js","sourceRoot":"","sources":["../Casino/CrapsGame.ts"],"names":[],"mappings":"AAAA;IAMI,eAAY,MAAc;QAH1B,cAAS,GAAW,CAAC,CAAC;QACtB,kBAAa,GAAQ,CAAC,CAAC;QAGnB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED,6BAAa,GAAb;QACI,QAAQ,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;QACzF,sCAAsC;QACtC,mCAAmC;QACnC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,6BAAa,GAAb;QACI,QAAQ,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC1D,EAAE,CAAA,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAA,CAAC;YAC3C,EAAE,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAC/C,CAAC;QAAC,IAAI,CAAA,CAAC;QAEP,CAAC;QACD,mCAAmC;QACnC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IACD,yBAAS,GAAT;IAEA,CAAC;IACJ,YAAC;AAAD,CAAC,AA9BF,IA8BE"} \ No newline at end of file diff --git a/js/GameInterface.js.map b/js/GameInterface.js.map deleted file mode 100644 index 6cfa9ae3..00000000 --- a/js/GameInterface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GameInterface.js","sourceRoot":"","sources":["../Casino/GameInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/MainMenu.js b/js/MainMenu.js deleted file mode 100644 index ccf62e13..00000000 --- a/js/MainMenu.js +++ /dev/null @@ -1,23 +0,0 @@ -var MainMenu = /** @class */ (function () { - function MainMenu() { - this.newCrapsGame = new Craps(this.mainPlayer); - this.chooseGame = this.chooseGame.bind(this); - } - MainMenu.prototype.start = function () { - UI.display("What game do you want to play?"); - UI.display("Craps or Craps?"); - UI.submitButton.addEventListener("click", this.chooseGame); - }; - MainMenu.prototype.chooseGame = function () { - UI.submitButton.removeEventListener("click", this.chooseGame); - if (UI.lastInput === "Craps") { - this.newCrapsGame.startGame(); - } - else { - UI.display("Too bad you're playing Craps!"); - this.newCrapsGame.startGame(); - } - }; - return MainMenu; -}()); -//# sourceMappingURL=MainMenu.js.map \ No newline at end of file diff --git a/js/MainMenu.js.map b/js/MainMenu.js.map deleted file mode 100644 index d2a16c7e..00000000 --- a/js/MainMenu.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MainMenu.js","sourceRoot":"","sources":["../Casino/MainMenu.ts"],"names":[],"mappings":"AAAA;IAGI;QADA,iBAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEtC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,wBAAK,GAAL;QACI,EAAE,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;QAC7C,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC9B,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IAEA,6BAAU,GAAV;QACG,EAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;QAEjC,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;YAC5C,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;QAClC,CAAC;IACL,CAAC;IAGL,eAAC;AAAD,CAAC,AAzBD,IAyBC"} \ No newline at end of file diff --git a/js/Player.js b/js/Player.js deleted file mode 100644 index 8c99c104..00000000 --- a/js/Player.js +++ /dev/null @@ -1,19 +0,0 @@ -var Player = /** @class */ (function () { - function Player(profile) { - this.playerProfile = profile; - } - Player.prototype.getProfile = function () { - return this.playerProfile; - }; - Player.prototype.getName = function () { - return this.playerProfile.getName; - }; - Player.prototype.getId = function () { - return this.playerProfile.getId; - }; - Player.prototype.getBalance = function () { - return this.playerProfile.getBalance; - }; - return Player; -}()); -//# sourceMappingURL=Player.js.map \ No newline at end of file diff --git a/js/Player.js.map b/js/Player.js.map deleted file mode 100644 index cf868bfb..00000000 --- a/js/Player.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Player.js","sourceRoot":"","sources":["../Casino/Player.ts"],"names":[],"mappings":"AAAA;IAII,gBAAY,OAAgB;QACxB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IACjC,CAAC;IACD,2BAAU,GAAV;QACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IACD,wBAAO,GAAP;QACG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;IACrC,CAAC;IACD,sBAAK,GAAL;QACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,2BAAU,GAAV;QACI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;IACzC,CAAC;IACL,aAAC;AAAD,CAAC,AApBD,IAoBC"} \ No newline at end of file diff --git a/js/PlayerInterface.js b/js/PlayerInterface.js deleted file mode 100644 index efe3ade6..00000000 --- a/js/PlayerInterface.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=PlayerInterface.js.map \ No newline at end of file diff --git a/js/PlayerInterface.js.map b/js/PlayerInterface.js.map deleted file mode 100644 index 3f899bd7..00000000 --- a/js/PlayerInterface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PlayerInterface.js","sourceRoot":"","sources":["../Casino/PlayerInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/Profile.js b/js/Profile.js deleted file mode 100644 index 8b84ea51..00000000 --- a/js/Profile.js +++ /dev/null @@ -1,54 +0,0 @@ -var Profile = /** @class */ (function () { - function Profile(id, name, balance) { - this.id = id; - this.name = name; - this.balance = balance; - } - Object.defineProperty(Profile.prototype, "getName", { - get: function () { - return this.name; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "getId", { - get: function () { - return this.id; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "getBalance", { - get: function () { - return this.balance; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "setId", { - set: function (id) { - this.id = id; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "setName", { - set: function (name) { - this.name = name; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Profile.prototype, "setBalance", { - set: function (balance) { - this.balance = balance; - }, - enumerable: true, - configurable: true - }); - Profile.prototype.addProfile = function (profile) { - this.listOfProfiles.push(profile); - }; - return Profile; -}()); -//# sourceMappingURL=Profile.js.map \ No newline at end of file diff --git a/js/Profile.js.map b/js/Profile.js.map deleted file mode 100644 index 384b8ba8..00000000 --- a/js/Profile.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../Casino/Profile.ts"],"names":[],"mappings":"AAAA;IAOI,iBAAY,EAAE,EAAE,IAAI,EAAE,OAAO;QACzB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IACD,sBAAI,4BAAO;aAAX;YACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,0BAAK;aAAT;YACI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,CAAC;;;OAAA;IAED,sBAAI,+BAAU;aAAd;YACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAED,sBAAI,0BAAK;aAAT,UAAU,EAAE;YACR,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,CAAC;;;OAAA;IAED,sBAAI,4BAAO;aAAX,UAAY,IAAI;YACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,+BAAU;aAAd,UAAe,OAAO;YAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;;;OAAA;IAEM,4BAAU,GAAjB,UAAkB,OAAgB;QAC9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEL,cAAC;AAAD,CAAC,AAxCD,IAwCC"} \ No newline at end of file diff --git a/js/UI.js b/js/UI.js deleted file mode 100644 index 361e1b74..00000000 --- a/js/UI.js +++ /dev/null @@ -1,31 +0,0 @@ -var UI = /** @class */ (function () { - function UI() { - UI.submitButton.addEventListener("click", function (e) { UI._lastInput = UI.userInput.value; }); - UI.submitButton.addEventListener("click", function (e) { UI.userInput.value = ''; }); - } - UI.display = function (input) { - this.window.innerText += input + '\n'; - }; - UI.clearScreen = function () { - this.window.innerText = ''; - }; - Object.defineProperty(UI, "Instance", { - get: function () { - return this._instance || (this._instance = new UI()); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(UI, "lastInput", { - get: function () { - return this._lastInput; - }, - enumerable: true, - configurable: true - }); - UI.userInput = document.getElementById("user_input"); - UI.window = document.getElementById('display'); - UI.submitButton = document.getElementById('submit'); - return UI; -}()); -//# sourceMappingURL=UI.js.map \ No newline at end of file diff --git a/js/UI.js.map b/js/UI.js.map deleted file mode 100644 index d34893f6..00000000 --- a/js/UI.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"UI.js","sourceRoot":"","sources":["../Casino/UI.ts"],"names":[],"mappings":"AAAA;IAOI;QACI,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAO,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC;QAChG,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAO,EAAE,CAAC,SAAS,CAAC,KAAK,GAAG,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;IACzF,CAAC;IAEM,UAAO,GAAd,UAAe,KAAa;QACxB,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,GAAG,IAAI,CAAC;IAC1C,CAAC;IAEM,cAAW,GAAlB;QACI,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;IAC/B,CAAC;IAED,sBAAkB,cAAQ;aAA1B;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;QACzD,CAAC;;;OAAA;IAED,sBAAkB,eAAS;aAA3B;YACI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC3B,CAAC;;;OAAA;IAzBE,YAAS,GAAqB,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAChE,SAAM,GAAmB,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5D,eAAY,GAAmB,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAwB5E,SAAC;CAAA,AA3BD,IA2BC"} \ No newline at end of file diff --git a/js/app.js b/js/app.js index 3ab2de54..7e01e7c5 100644 --- a/js/app.js +++ b/js/app.js @@ -1,12 +1,168 @@ var App = /** @class */ (function () { function App() { - this.mainMenu = new MainMenu(); + this.newMainMenu = new MainMenu; } - App.prototype.startCasino = function () { - UI.Instance; - this.mainMenu.start(); + App.main = function () { }; return App; }()); -this.app.startCasino(); +var UI = /** @class */ (function () { + function UI() { + UI.submitButton.addEventListener("click", function (e) { UI._lastInput = UI.userInput.value; }); + UI.submitButton.addEventListener("click", function (e) { UI.userInput.value = ''; }); + } + UI.display = function (input) { + this.window.innerText += input + '\n'; + }; + UI.clearScreen = function () { + this.window.innerText = ''; + }; + Object.defineProperty(UI, "Instance", { + get: function () { + return this._instance || (this._instance = new UI()); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UI, "lastInput", { + get: function () { + return this._lastInput; + }, + enumerable: true, + configurable: true + }); + UI.userInput = document.getElementById("user_input"); + UI.window = document.getElementById('display'); + UI.submitButton = document.getElementById('submit'); + return UI; +}()); +var Craps = /** @class */ (function () { + function Craps(player) { + this.betAmount = 0; + this.betUserPlaces = 0; + this.crapsPlayer = player; + } + Craps.prototype.userPlacesBet = function () { + UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + // event handler here for the bet type + // set user bet places to the input + UI.clearScreen(); + }; + Craps.prototype.userBetAmount = function () { + UI.display("Please enter your bet amount down below"); + if (this.betAmount > this.crapsPlayer.getBalance()) { + UI.display("You can't bet that much!"); + } + else { + //event handler here for bet amount + } + UI.clearScreen(); + }; + Craps.prototype.startGame = function () { + }; + return Craps; +}()); +var Dice = /** @class */ (function () { + function Dice() { + this.sides = 6; + } + Dice.prototype.rollDice = function () { + }; + return Dice; +}()); +var MainMenu = /** @class */ (function () { + function MainMenu() { + this.newCrapsGame = new Craps(this.mainPlayer); + this.chooseGame = this.chooseGame.bind(this); + } + MainMenu.prototype.start = function () { + UI.display("What game do you want to play?"); + UI.display("Craps or Craps?"); + UI.submitButton.addEventListener("click", this.chooseGame); + }; + MainMenu.prototype.chooseGame = function () { + UI.submitButton.removeEventListener("click", this.chooseGame); + if (UI.lastInput === "Craps") { + this.newCrapsGame.startGame(); + } + else { + UI.display("Too bad you're playing Craps!"); + this.newCrapsGame.startGame(); + } + }; + return MainMenu; +}()); +var Player = /** @class */ (function () { + function Player(profile) { + this.playerProfile = profile; + } + Player.prototype.getProfile = function () { + return this.playerProfile; + }; + Player.prototype.getName = function () { + return this.playerProfile.getName; + }; + Player.prototype.getId = function () { + return this.playerProfile.getId; + }; + Player.prototype.getBalance = function () { + return this.playerProfile.getBalance; + }; + return Player; +}()); +var Profile = /** @class */ (function () { + function Profile(id, name, balance) { + this.id = id; + this.name = name; + this.balance = balance; + } + Object.defineProperty(Profile.prototype, "getName", { + get: function () { + return this.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "getId", { + get: function () { + return this.id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "getBalance", { + get: function () { + return this.balance; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "setId", { + set: function (id) { + this.id = id; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "setName", { + set: function (name) { + this.name = name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Profile.prototype, "setBalance", { + set: function (balance) { + this.balance = balance; + }, + enumerable: true, + configurable: true + }); + Profile.prototype.addProfile = function (profile) { + this.listOfProfiles.push(profile); + }; + return Profile; +}()); +var instance = UI.Instance; +App.main(); //# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/js/app.js.map b/js/app.js.map index e9641dd1..d0b750c5 100644 --- a/js/app.js.map +++ b/js/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../Casino/app.ts"],"names":[],"mappings":"AAAA;IAAA;QACI,aAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAM9B,CAAC;IALE,yBAAW,GAAX;QACK,EAAE,CAAC,QAAQ,CAAC;QACZ,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAEL,UAAC;AAAD,CAAC,AAPD,IAOC;AACD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"app.js","sourceRoot":"","sources":["../Casino/app.ts"],"names":[],"mappings":"AAAA;IAAA;QACQ,gBAAW,GAAG,IAAI,QAAQ,CAAC;IAInC,CAAC;IAHgB,QAAI,GAAlB;IAEA,CAAC;IACJ,UAAC;AAAD,CAAC,AALD,IAKC;AACD;IAOQ;QACI,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAO,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC;QAChG,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,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D,IAwCC;AAED,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AAC7B,GAAG,CAAC,IAAI,EAAE,CAAC"} \ No newline at end of file From 8218e19da98fa1f3842751f8c6e83da5bba6516b Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sun, 25 Mar 2018 21:23:22 -0400 Subject: [PATCH 6/8] Saving --- Casino/app.ts | 53 +++++++++++++++++++++++++---------------- js/GameInterface.js.map | 1 + js/app.js | 39 +++++++++++++++++++----------- js/app.js.map | 2 +- 4 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 js/GameInterface.js.map diff --git a/Casino/app.ts b/Casino/app.ts index f3cc3754..13fb32e9 100644 --- a/Casino/app.ts +++ b/Casino/app.ts @@ -1,53 +1,62 @@ class App { - newMainMenu = new MainMenu; public static main(): void{ - + var profile = new Profile(123,"Bob", 100); + var newPlayer = new Player(profile); + var craps : Craps = new Craps(newPlayer) + craps.startGame(); + craps.userPlacesBet(); + } } class UI{ - static userInput = document.getElementById("user_input"); - static window = document.getElementById('display'); + static textBox = document.getElementById("user_input"); + static displayWindow = document.getElementById('display'); static submitButton = document.getElementById('submit'); - static _lastInput: any; - private static _instance: UI; + static actualUserInput: any; + private static instance: UI; private constructor() { - UI.submitButton.addEventListener("click", (e: Event) => { UI._lastInput = UI.userInput.value }); - UI.submitButton.addEventListener("click", (e: Event) => { UI.userInput.value = '' }); + UI.submitButton.addEventListener("click", (e: Event) => { UI.actualUserInput = UI.textBox.value }); + UI.submitButton.addEventListener("click", (e: Event) => { UI.textBox.value = '' }); } static display(input: string): void { - this.window.innerText += input + '\n'; + this.displayWindow.innerText += input + '\n'; } static clearScreen(): void { - this.window.innerText = ''; + this.displayWindow.innerText = ''; } public static get Instance(): UI { - return this._instance || (this._instance = new UI()); + return this.instance || (this.instance = new UI()); } public static get lastInput(): any { - return this._lastInput; + return this.actualUserInput; } } class Craps{ crapsPlayer: Player; - betAmount: number = 0; - betUserPlaces: any = 0; + betAmount: any; + betUserPlaces: any; constructor(player: Player){ this.crapsPlayer = player; + this.userPlacesBet = this.userPlacesBet.bind(this); + + } - + userPlacesBet(){ - UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); - // event handler here for the bet type - // set user bet places to the input - + UI.submitButton.removeEventListener("click", this.userPlacesBet); + if (UI.lastInput === "Pass Line"){ + UI.display("Hello"); + } else{ + UI.display("Bye"); + } UI.clearScreen(); } @@ -62,14 +71,16 @@ class Craps{ } startGame(){ - + UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + UI.submitButton.addEventListener("click", this.userPlacesBet); } } class Dice{ sides = 6; rollDice(){ - + var randNumber = Math.floor(Math.random()* this.sides) + 1; + return randNumber; } } diff --git a/js/GameInterface.js.map b/js/GameInterface.js.map new file mode 100644 index 00000000..6cfa9ae3 --- /dev/null +++ b/js/GameInterface.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GameInterface.js","sourceRoot":"","sources":["../Casino/GameInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/app.js b/js/app.js index 7e01e7c5..83d63bad 100644 --- a/js/app.js +++ b/js/app.js @@ -1,51 +1,58 @@ var App = /** @class */ (function () { function App() { - this.newMainMenu = new MainMenu; } App.main = function () { + var profile = new Profile(123, "Bob", 100); + var newPlayer = new Player(profile); + var craps = new Craps(newPlayer); + craps.startGame(); + craps.userPlacesBet(); }; return App; }()); var UI = /** @class */ (function () { function UI() { - UI.submitButton.addEventListener("click", function (e) { UI._lastInput = UI.userInput.value; }); - UI.submitButton.addEventListener("click", function (e) { UI.userInput.value = ''; }); + UI.submitButton.addEventListener("click", function (e) { UI.actualUserInput = UI.textBox.value; }); + UI.submitButton.addEventListener("click", function (e) { UI.textBox.value = ''; }); } UI.display = function (input) { - this.window.innerText += input + '\n'; + this.displayWindow.innerText += input + '\n'; }; UI.clearScreen = function () { - this.window.innerText = ''; + this.displayWindow.innerText = ''; }; Object.defineProperty(UI, "Instance", { get: function () { - return this._instance || (this._instance = new UI()); + return this.instance || (this.instance = new UI()); }, enumerable: true, configurable: true }); Object.defineProperty(UI, "lastInput", { get: function () { - return this._lastInput; + return this.actualUserInput; }, enumerable: true, configurable: true }); - UI.userInput = document.getElementById("user_input"); - UI.window = document.getElementById('display'); + UI.textBox = document.getElementById("user_input"); + UI.displayWindow = document.getElementById('display'); UI.submitButton = document.getElementById('submit'); return UI; }()); var Craps = /** @class */ (function () { function Craps(player) { - this.betAmount = 0; - this.betUserPlaces = 0; this.crapsPlayer = player; + this.userPlacesBet = this.userPlacesBet.bind(this); } Craps.prototype.userPlacesBet = function () { - UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); - // event handler here for the bet type - // set user bet places to the input + UI.submitButton.removeEventListener("click", this.userPlacesBet); + if (UI.lastInput === "Pass Line") { + UI.display("Hello"); + } + else { + UI.display("Bye"); + } UI.clearScreen(); }; Craps.prototype.userBetAmount = function () { @@ -59,6 +66,8 @@ var Craps = /** @class */ (function () { UI.clearScreen(); }; Craps.prototype.startGame = function () { + UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + UI.submitButton.addEventListener("click", this.userPlacesBet); }; return Craps; }()); @@ -67,6 +76,8 @@ var Dice = /** @class */ (function () { this.sides = 6; } Dice.prototype.rollDice = function () { + var randNumber = Math.floor(Math.random() * this.sides) + 1; + return randNumber; }; return Dice; }()); diff --git a/js/app.js.map b/js/app.js.map index d0b750c5..f3e37607 100644 --- a/js/app.js.map +++ b/js/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../Casino/app.ts"],"names":[],"mappings":"AAAA;IAAA;QACQ,gBAAW,GAAG,IAAI,QAAQ,CAAC;IAInC,CAAC;IAHgB,QAAI,GAAlB;IAEA,CAAC;IACJ,UAAC;AAAD,CAAC,AALD,IAKC;AACD;IAOQ;QACI,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAO,EAAE,CAAC,UAAU,GAAG,EAAE,CAA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,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;;;OAAA;IAEM,4BAAU,GAAjB,UAAkB,OAAgB;QAC9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEN,cAAC;AAAD,CAAC,AAxCD,IAwCC;AAED,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AAC7B,GAAG,CAAC,IAAI,EAAE,CAAC"} \ No newline at end of file From 1cca72de15acfcbb63295d2f4082256a4dd92321 Mon Sep 17 00:00:00 2001 From: CWinarski Date: Sun, 25 Mar 2018 23:18:24 -0400 Subject: [PATCH 7/8] Fleshed out craps more --- Casino/Gamble.ts | 3 -- Casino/GameEngine.ts | 3 -- Casino/GameEngineInterface.ts | 3 -- Casino/GameInterface.ts | 3 -- Casino/app.ts | 77 +++++++++++++++++++++++++++++++---- js/Gamble.js | 6 --- js/Gamble.js.map | 1 - js/GameEngine.js | 6 --- js/GameEngine.js.map | 1 - js/GameEngineInterface.js | 1 - js/GameEngineInterface.js.map | 1 - js/GameInterface.js | 1 - js/GameInterface.js.map | 1 - js/app.js | 62 +++++++++++++++++++++++++++- js/app.js.map | 2 +- 15 files changed, 131 insertions(+), 40 deletions(-) delete mode 100644 Casino/Gamble.ts delete mode 100644 Casino/GameEngine.ts delete mode 100644 Casino/GameEngineInterface.ts delete mode 100644 Casino/GameInterface.ts delete mode 100644 js/Gamble.js delete mode 100644 js/Gamble.js.map delete mode 100644 js/GameEngine.js delete mode 100644 js/GameEngine.js.map delete mode 100644 js/GameEngineInterface.js delete mode 100644 js/GameEngineInterface.js.map delete mode 100644 js/GameInterface.js delete mode 100644 js/GameInterface.js.map diff --git a/Casino/Gamble.ts b/Casino/Gamble.ts deleted file mode 100644 index a31e46ed..00000000 --- a/Casino/Gamble.ts +++ /dev/null @@ -1,3 +0,0 @@ - class Gamble{ - -} \ No newline at end of file diff --git a/Casino/GameEngine.ts b/Casino/GameEngine.ts deleted file mode 100644 index 99690c9d..00000000 --- a/Casino/GameEngine.ts +++ /dev/null @@ -1,3 +0,0 @@ -class GameEngine{ - -} \ No newline at end of file diff --git a/Casino/GameEngineInterface.ts b/Casino/GameEngineInterface.ts deleted file mode 100644 index 28e1ebb3..00000000 --- a/Casino/GameEngineInterface.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface GameEngineInterface{ - -} \ No newline at end of file diff --git a/Casino/GameInterface.ts b/Casino/GameInterface.ts deleted file mode 100644 index a62a4b93..00000000 --- a/Casino/GameInterface.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface GameInterface { - //hjf -} \ No newline at end of file diff --git a/Casino/app.ts b/Casino/app.ts index 13fb32e9..e1cb3c79 100644 --- a/Casino/app.ts +++ b/Casino/app.ts @@ -38,22 +38,21 @@ class UI{ } class Craps{ - + setOfDice: Dice; crapsPlayer: Player; betAmount: any; betUserPlaces: any; - + rollValue: number; + constructor(player: Player){ this.crapsPlayer = player; this.userPlacesBet = this.userPlacesBet.bind(this); - - } userPlacesBet(){ UI.submitButton.removeEventListener("click", this.userPlacesBet); if (UI.lastInput === "Pass Line"){ - UI.display("Hello"); + this.passLineBetTurnSequence(this.rollValue); } else{ UI.display("Bye"); } @@ -65,11 +64,56 @@ class Craps{ if(this.betAmount > this.crapsPlayer.getBalance()){ UI.display("You can't bet that much!"); } else{ - //event handler here for bet amount + this.betAmount = UI.lastInput(); } UI.clearScreen(); } - + + addDiceTogether(): number{ + UI.display("Rolling Dice"); + this.rollValue = this.setOfDice.rollDice() + this.setOfDice.rollDice(); + return this.rollValue; + } + + passLineBetTurnSequence(rollValue: number): void { + if (rollValue === 7 || rollValue === 11) { + this.playerWins(); + } else if (rollValue === 2 || rollValue === 3 || rollValue === 12) { + this.playerLoses(); + } else { + this.passLineBetRollsNonWinOrLoseNumber(rollValue); + } + } + + passLineBetRollsNonWinOrLoseNumber(rollValue: number): void { + let currentRoll= 0; + do { + currentRoll = this.addDiceTogether(); + + if (currentRoll === 7) { + this.playerLoses(); + break; + + } else if (currentRoll === this.rollValue) { + + this.playerWins(); + break; + } + } while (currentRoll != 7 || currentRoll != this.rollValue); + + } + + playerWins(){ + UI.display("You Win!"); + } + + playerLoses(){ + UI.display("You Lose!"); + } + + willUserPlayAgain(){ + UI.display("Do you want to play again? Y/N") + } startGame(){ UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); UI.submitButton.addEventListener("click", this.userPlacesBet); @@ -181,5 +225,24 @@ class Profile{ } +class Wallet{ + private balance: number; + + constructor(){ + this.balance = 0; + } + + get Balance(){ + return this.balance; + } + + add(money: number): void{ + this.balance =+ money; + } + + subtract(money: number){ + this.balance =+ money; + } +} const instance = UI.Instance; App.main(); diff --git a/js/Gamble.js b/js/Gamble.js deleted file mode 100644 index 6c14251a..00000000 --- a/js/Gamble.js +++ /dev/null @@ -1,6 +0,0 @@ -var Gamble = /** @class */ (function () { - function Gamble() { - } - return Gamble; -}()); -//# sourceMappingURL=Gamble.js.map \ No newline at end of file diff --git a/js/Gamble.js.map b/js/Gamble.js.map deleted file mode 100644 index c8603225..00000000 --- a/js/Gamble.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Gamble.js","sourceRoot":"","sources":["../Casino/Gamble.ts"],"names":[],"mappings":"AAAC;IAAA;IAED,CAAC;IAAD,aAAC;AAAD,CAAC,AAFA,IAEA"} \ No newline at end of file diff --git a/js/GameEngine.js b/js/GameEngine.js deleted file mode 100644 index c6aa1d17..00000000 --- a/js/GameEngine.js +++ /dev/null @@ -1,6 +0,0 @@ -var GameEngine = /** @class */ (function () { - function GameEngine() { - } - return GameEngine; -}()); -//# sourceMappingURL=GameEngine.js.map \ No newline at end of file diff --git a/js/GameEngine.js.map b/js/GameEngine.js.map deleted file mode 100644 index 923d3518..00000000 --- a/js/GameEngine.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GameEngine.js","sourceRoot":"","sources":["../Casino/GameEngine.ts"],"names":[],"mappings":"AAAA;IAAA;IAEA,CAAC;IAAD,iBAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/js/GameEngineInterface.js b/js/GameEngineInterface.js deleted file mode 100644 index a0a73ec2..00000000 --- a/js/GameEngineInterface.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=GameEngineInterface.js.map \ No newline at end of file diff --git a/js/GameEngineInterface.js.map b/js/GameEngineInterface.js.map deleted file mode 100644 index e05535e4..00000000 --- a/js/GameEngineInterface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GameEngineInterface.js","sourceRoot":"","sources":["../Casino/GameEngineInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/GameInterface.js b/js/GameInterface.js deleted file mode 100644 index 157d9a34..00000000 --- a/js/GameInterface.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=GameInterface.js.map \ No newline at end of file diff --git a/js/GameInterface.js.map b/js/GameInterface.js.map deleted file mode 100644 index 6cfa9ae3..00000000 --- a/js/GameInterface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GameInterface.js","sourceRoot":"","sources":["../Casino/GameInterface.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/js/app.js b/js/app.js index 83d63bad..89714d53 100644 --- a/js/app.js +++ b/js/app.js @@ -48,7 +48,7 @@ var Craps = /** @class */ (function () { Craps.prototype.userPlacesBet = function () { UI.submitButton.removeEventListener("click", this.userPlacesBet); if (UI.lastInput === "Pass Line") { - UI.display("Hello"); + this.passLineBetTurnSequence(this.rollValue); } else { UI.display("Bye"); @@ -61,10 +61,49 @@ var Craps = /** @class */ (function () { UI.display("You can't bet that much!"); } else { - //event handler here for bet amount + this.betAmount = UI.lastInput(); } UI.clearScreen(); }; + Craps.prototype.addDiceTogether = function () { + UI.display("Rolling Dice"); + this.rollValue = this.setOfDice.rollDice() + this.setOfDice.rollDice(); + return this.rollValue; + }; + Craps.prototype.passLineBetTurnSequence = function (rollValue) { + if (rollValue === 7 || rollValue === 11) { + this.playerWins(); + } + else if (rollValue === 2 || rollValue === 3 || rollValue === 12) { + this.playerLoses(); + } + else { + this.passLineBetRollsNonWinOrLoseNumber(rollValue); + } + }; + Craps.prototype.passLineBetRollsNonWinOrLoseNumber = function (rollValue) { + var currentRoll = 0; + do { + currentRoll = this.addDiceTogether(); + if (currentRoll === 7) { + this.playerLoses(); + break; + } + else if (currentRoll === this.rollValue) { + this.playerWins(); + break; + } + } while (currentRoll != 7 || currentRoll != this.rollValue); + }; + Craps.prototype.playerWins = function () { + UI.display("You Win!"); + }; + Craps.prototype.playerLoses = function () { + UI.display("You Lose!"); + }; + Craps.prototype.willUserPlayAgain = function () { + UI.display("Do you want to play again? Y/N"); + }; Craps.prototype.startGame = function () { UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); UI.submitButton.addEventListener("click", this.userPlacesBet); @@ -174,6 +213,25 @@ var Profile = /** @class */ (function () { }; return Profile; }()); +var Wallet = /** @class */ (function () { + function Wallet() { + this.balance = 0; + } + Object.defineProperty(Wallet.prototype, "Balance", { + get: function () { + return this.balance; + }, + enumerable: true, + configurable: true + }); + Wallet.prototype.add = function (money) { + this.balance = +money; + }; + Wallet.prototype.subtract = function (money) { + this.balance = +money; + }; + return Wallet; +}()); var instance = UI.Instance; App.main(); //# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/js/app.js.map b/js/app.js.map index f3e37607..f8e54377 100644 --- a/js/app.js.map +++ b/js/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../Casino/app.ts"],"names":[],"mappings":"AAAA;IAAA;IASA,CAAC;IARgB,QAAI,GAAlB;QACG,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1C,IAAK,SAAS,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,GAAW,IAAI,KAAK,CAAC,SAAS,CAAC,CAAA;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I,CAAC,OAAO,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,sBAAI,2BAAO;aAAX;YACI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAED,oBAAG,GAAH,UAAI,KAAa;QAChB,IAAI,CAAC,OAAO,GAAE,CAAE,KAAK,CAAC;IACvB,CAAC;IAED,yBAAQ,GAAR,UAAS,KAAa;QAClB,IAAI,CAAC,OAAO,GAAE,CAAE,KAAK,CAAC;IAC1B,CAAC;IACL,aAAC;AAAD,CAAC,AAlBD,IAkBC;AACD,IAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AAC7B,GAAG,CAAC,IAAI,EAAE,CAAC"} \ No newline at end of file From 5cee6a4394e6ff0eaf204f0f0c5541b653af75af Mon Sep 17 00:00:00 2001 From: CWinarski Date: Mon, 26 Mar 2018 08:38:55 -0400 Subject: [PATCH 8/8] Added More --- Casino/app.ts | 47 +++++++++++++++++++++++++++++++++++++---------- js/app.js | 42 ++++++++++++++++++++++++++++++++++-------- js/app.js.map | 2 +- 3 files changed, 72 insertions(+), 19 deletions(-) diff --git a/Casino/app.ts b/Casino/app.ts index e1cb3c79..e61220ab 100644 --- a/Casino/app.ts +++ b/Casino/app.ts @@ -2,10 +2,10 @@ class App { public static main(): void{ var profile = new Profile(123,"Bob", 100); var newPlayer = new Player(profile); - var craps : Craps = new Craps(newPlayer) - craps.startGame(); - craps.userPlacesBet(); - + var mainMenu = new MainMenu; + var craps : Craps = new Craps(newPlayer) + mainMenu.start(); + } } class UI{ @@ -53,8 +53,8 @@ class Craps{ UI.submitButton.removeEventListener("click", this.userPlacesBet); if (UI.lastInput === "Pass Line"){ this.passLineBetTurnSequence(this.rollValue); - } else{ - UI.display("Bye"); + } else if(UI.lastInput === "Don't Pass Line"){ + this.dontPassLineBetTurnSequence(this.rollValue) } UI.clearScreen(); } @@ -99,10 +99,36 @@ class Craps{ this.playerWins(); break; } - } while (currentRoll != 7 || currentRoll != this.rollValue); + } while (currentRoll !== 7 || currentRoll !== this.rollValue); } + + dontPassLineBetTurnSequence(rollValue: number): void { + if (rollValue == 2 || rollValue == 3) { + this.playerWins(); + } else if (rollValue == 7 || rollValue == 11) { + this.playerLoses(); + } else { + this.dontPassLineBetRollNonWinLoseNumber(rollValue); + } + } + dontPassLineBetRollNonWinLoseNumber(rollValue: number) { + let currentRoll = 0; + do { + currentRoll = this.addDiceTogether(); + + if (rollValue === 7) { + this.playerWins(); + break; + } else if (currentRoll === rollValue) { + this.playerLoses(); + break; + } + } while (currentRoll !== 7 || currentRoll !== rollValue); + + } + playerWins(){ UI.display("You Win!"); } @@ -115,8 +141,10 @@ class Craps{ UI.display("Do you want to play again? Y/N") } startGame(){ - UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + UI.display("Hello! Please enter in Pass Line or Don't Pass Line for you bet below"); UI.submitButton.addEventListener("click", this.userPlacesBet); + this.rollValue = this.addDiceTogether(); + this.userPlacesBet(); } } @@ -147,8 +175,7 @@ class MainMenu{ this.newCrapsGame.startGame(); } else { - UI.display("Too bad you're playing Craps!"); - this.newCrapsGame.startGame(); + UI.display("Ok, that's cool. Good Bye!"); } } diff --git a/js/app.js b/js/app.js index 89714d53..ec493bb0 100644 --- a/js/app.js +++ b/js/app.js @@ -4,9 +4,9 @@ var App = /** @class */ (function () { App.main = function () { var profile = new Profile(123, "Bob", 100); var newPlayer = new Player(profile); + var mainMenu = new MainMenu; var craps = new Craps(newPlayer); - craps.startGame(); - craps.userPlacesBet(); + mainMenu.start(); }; return App; }()); @@ -50,8 +50,8 @@ var Craps = /** @class */ (function () { if (UI.lastInput === "Pass Line") { this.passLineBetTurnSequence(this.rollValue); } - else { - UI.display("Bye"); + else if (UI.lastInput === "Don't Pass Line") { + this.dontPassLineBetTurnSequence(this.rollValue); } UI.clearScreen(); }; @@ -93,7 +93,32 @@ var Craps = /** @class */ (function () { this.playerWins(); break; } - } while (currentRoll != 7 || currentRoll != this.rollValue); + } while (currentRoll !== 7 || currentRoll !== this.rollValue); + }; + Craps.prototype.dontPassLineBetTurnSequence = function (rollValue) { + if (rollValue == 2 || rollValue == 3) { + this.playerWins(); + } + else if (rollValue == 7 || rollValue == 11) { + this.playerLoses(); + } + else { + this.dontPassLineBetRollNonWinLoseNumber(rollValue); + } + }; + Craps.prototype.dontPassLineBetRollNonWinLoseNumber = function (rollValue) { + var currentRoll = 0; + do { + currentRoll = this.addDiceTogether(); + if (rollValue === 7) { + this.playerWins(); + break; + } + else if (currentRoll === rollValue) { + this.playerLoses(); + break; + } + } while (currentRoll !== 7 || currentRoll !== rollValue); }; Craps.prototype.playerWins = function () { UI.display("You Win!"); @@ -105,8 +130,10 @@ var Craps = /** @class */ (function () { UI.display("Do you want to play again? Y/N"); }; Craps.prototype.startGame = function () { - UI.display("Hello!, please enter in Pass Line or Don't pass line for you bet below"); + UI.display("Hello! Please enter in Pass Line or Don't Pass Line for you bet below"); UI.submitButton.addEventListener("click", this.userPlacesBet); + this.rollValue = this.addDiceTogether(); + this.userPlacesBet(); }; return Craps; }()); @@ -136,8 +163,7 @@ var MainMenu = /** @class */ (function () { this.newCrapsGame.startGame(); } else { - UI.display("Too bad you're playing Craps!"); - this.newCrapsGame.startGame(); + UI.display("Ok, that's cool. Good Bye!"); } }; return MainMenu; diff --git a/js/app.js.map b/js/app.js.map index f8e54377..09bd78b9 100644 --- a/js/app.js.map +++ b/js/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../Casino/app.ts"],"names":[],"mappings":"AAAA;IAAA;IASA,CAAC;IARgB,QAAI,GAAlB;QACG,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1C,IAAK,SAAS,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,GAAW,IAAI,KAAK,CAAC,SAAS,CAAC,CAAA;QACxC,KAAK,CAAC,SAAS,EAAE,CAAC;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