anchor.diff:              {Attacker, CardType} = lists:keyfind(Attacker, 1, Field),
               %io:format("Got card: ~p~n", [get_card(CardType)]),
               Card = get_card(CardType),
  -            unit =:= Card#card.type
  +            unit =:= Card#card_def.type
           end, Attackers)
     catch
       _Error:_Exception ->
  
positive.code:   Supply ++  Units.
  
  supply_card() ->
    #card{key = supply1, attrs=[ {supply, 1 } ]}.
  soldier_card() ->
    #card{key = soldier, cost = 1, type = unit, attrs=[ {attack, 1}, {defense, 1} ]}.
  
  test_player(Id) ->
    #player{id= Id, deck=shuffle_list(test_deck())}.
  
  init_card_defs() ->
    card_defs = ets:new(card_defs, [public, named_table, {keypos, #card.key}]),
    ets:insert(card_defs, supply_card()),
    ets:insert(card_defs, soldier_card()).
  
  get_card(Id) ->
    [#card{} = Card] =  ets:lookup(card_defs, Id),
    Card.
  
  new_game() ->
  
negative.code: -type card_type() :: supply | unit | realm.
  -record(game, {players = []}).
  -record(player, {id, hand = [], discard = [], deck = [], lost = [], field = [], life = 20, supply = 0}).
  -record(card_def, {key, cost = 0, reqs=[], type = supply :: card_type(), attrs = []}).
  -type card_attachment() :: any()
  -record(card, {key, type, attached}).
  
  init_rand() ->
    <<A:32,B:32,C:32>> = crypto:rand_bytes(12),
  