Skip to content

Instantly share code, notes, and snippets.

@landongn
Created December 10, 2016 23:46
Show Gist options
  • Save landongn/fbbbdbc25f6523eaa471442bdc43c935 to your computer and use it in GitHub Desktop.
Save landongn/fbbbdbc25f6523eaa471442bdc43c935 to your computer and use it in GitHub Desktop.
require Logger
alias Server.Repo
alias Server.Character
defmodule Server.World do
@online %{}
def join(character) do
online = Map.put @online, character.id, character
Logger.info "character #{inspect character.name} has come online"
end
def round(cid, mid) do
#fight!
end
def win(cid, mid) do
#you win
end
def lose(cid, mid) do
#you died :(
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment