This file contains hidden or 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
game = new MonopolyGame() #... | |
game.roll_dice() | |
game.invite_friend_to_a_game(friend) | |
game.buy_prize_for_points(prize) | |
... | |
ebay = new eBay() | |
ebay.try_to_list_item(item_definition) | |
ebay.buyer_bids(buyer, bid) | |
ebay.listing_ended(listing) |
This file contains hidden or 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
async.waterfall([ | |
function(callback){ | |
callback(null, 'one', 'two'); | |
}, | |
function(arg1, arg2, callback){ | |
callback(null, 'three'); | |
}, | |
function(arg1, callback){ | |
// arg1 now equals 'three' | |
callback(null, 'done'); |
This file contains hidden or 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
#= require ./init | |
class engine.Services | |
constructor: (eventBroker, gameBasicDetails, gameDetails) -> | |
@screenRenderer = new shared.views.ScreenRenderer("#{gameBasicDetails.template}/templates/game_screen") | |
@soundAdapter = new shared.sounds.SoundAdapter( | |
gameDetails.game.sounds_dir, | |
gameDetails.game.sound_names) |
This file contains hidden or 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
#= require ./engine/engine | |
$ -> | |
(new shooter.aspects.AppLoaderScreen()).execute() | |
gameboxedEngine = new engine.GameEngine() | |
gameboxedEngine.bootstrap(gameBasicDetails, null) | |
This file contains hidden or 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
/home/nthx/market/app/assets/javascripts/engine (4 usages) | |
engine.js.coffee (3 usages) | |
(56: 15) @services.appLoader.bind("components:loaded", => @eventBroker.trigger("assets:loaded")) | |
(57: 15) @services.appLoader.run() | |
(66: 15) @services.appLoader.componentsLoaded() | |
services.js.coffee (1 usage) |
This file contains hidden or 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
sample_scenario = -> | |
game = new BoardGame('Arkham') | |
tom = new Player('tomasz') | |
game.generate_example_move(tom) | |
alert game.calculate_bonus_for_player(tom) | |
class BoardGame | |
constructor: () -> | |
@board_cells = [] |
This file contains hidden or 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
class PlayingMonopolyUseCase | |
execute: (game, player, board) => | |
game.player_throws_a_dice(player, | |
(field) -> | |
bonuses = game.apply_bonuses_from_field_cards(player, field) | |
game.take_other_players_bets_and_pick_best_and_apply(player) | |
if bonuses |
This file contains hidden or 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
class Player | |
constructor: (@name, @age) -> | |
throw_a_dice: () => | |
... | |
pick_a_card: () => | |
... |
This file contains hidden or 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
class RunningABikeUseCase | |
def execute(player) | |
player.wakeUpAndRide #looks nice to read, but hides important | |
player.rest #detail on what "wakeUpAndRide" really is | |
end | |
end | |
class RunningABikeAndFailingUseCase | |
def execute(player) |
This file contains hidden or 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
class RunningABikeUseCase | |
def execute(player) | |
player.wakeUp | |
player.getTheBike | |
player.ride | |
player.rest | |
end | |
end | |