-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Rack } from "../../utils/rack" | ||
import { NineBall } from "./nineball" | ||
import { Rules } from "./rules" | ||
|
||
export class FourteenOne extends NineBall implements Rules { | ||
override rack() { | ||
return Rack.triangle() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "mocha" | ||
import { expect } from "chai" | ||
import { Container } from "../../src/container/container" | ||
import { Aim } from "../../src/controller/aim" | ||
import { PlayShot } from "../../src/controller/playshot" | ||
import { StationaryEvent } from "../../src/events/stationaryevent" | ||
import { GameEvent } from "../../src/events/gameevent" | ||
import { Outcome } from "../../src/model/outcome" | ||
import { RuleFactory } from "../../src/controller/rules/rulefactory" | ||
import { WatchAim } from "../../src/controller/watchaim" | ||
import { initDom } from "../view/dom" | ||
|
||
initDom() | ||
|
||
describe("FourteenOne", () => { | ||
let container: Container | ||
let broadcastEvents: GameEvent[] | ||
const rule = "fourteenone" | ||
|
||
beforeEach(function (done) { | ||
container = new Container(undefined, (_) => {}, false, rule) | ||
broadcastEvents = [] | ||
container.broadcast = (x) => broadcastEvents.push(x) | ||
done() | ||
}) | ||
|
||
it("Fourteenone has 16 balls", (done) => { | ||
expect(container.table.balls).to.be.length(16) | ||
done() | ||
}) | ||
}) |