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 Location | |
attr_reader :x, :y | |
def self.find_available_location | |
begin | |
location = Location.new(rand(1..10), rand(1..10)) | |
end until location.empty? | |
location | |
end |
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
module Attacker | |
def attack(target) | |
end | |
end |
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
module Attacker | |
def attack(target) | |
end | |
end |
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 'spec_helper' | |
describe CharacterAttacksAnotherCharacter do | |
before do | |
@luke = stub | |
@vader = stub | |
@attack = CharacterAttacksAnotherCharacter.new(@luke, @vader) | |
end | |
describe "constructor" do |
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
module Attacker | |
# def attack(foo) | |
# end | |
end |
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
module Attacker | |
def attack(foo) | |
end | |
end |
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 AttacksController | |
def create | |
attacker = current_users.characters.find(params[:attacker_id]) | |
target = Character.find_by_x_and_y(params[:x], params[:y]) | |
attack = CharacterAttacksAnotherCharacter.new(attacker, target) | |
attack.execute! | |
end | |
end |
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 "rubygems" | |
require "sinatra" | |
require "oauth2" | |
get "/" do | |
haml :index | |
end | |
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
window.BadgeView = Backbone.View.extend | |
model: Territory | |
tagName: "li" | |
events: | |
"click" : "handleClick" | |
initialize: -> | |
@model.bind("change:unitsCount", @unitsCountChanged, @) |
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
.badges { | |
li { | |
width: 32px; | |
height: 32px; | |
text-align: center; | |
line-height: 34px; | |
font-size: 12px; | |
background: black; | |
border-radius: 50%; | |
border: 2px solid #333; |