BattleSim/client/app/js/collections/battles/battle_collection.coffee

9 lines
194 B
CoffeeScript

class @BattleCollection extends Backbone.Collection
model: Battle
isPlaying: ->
@find((battle) -> battle.isPlaying())?
playingBattles: ->
@filter((battle) -> battle.isPlaying())