PageRenderTime 92ms CodeModel.GetById 71ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 0ms

/army/hwh/bf.erl

http://erlbattle.googlecode.com/
Erlang | 22 lines | 19 code | 3 blank | 0 comment | 0 complexity | 8d8057031e582be5cfd44e99205f814f MD5 | raw file
 1-module(hwh.bf).
 2-compile(export_all).
 3-include("schema.hrl").
 4
 5
 6get_soldier_by_position(Position) ->
 7	Pattern=#soldier{
 8				id='_',
 9				position=Position,
10				hp='_',
11				facing='_',
12				action='_',
13				act_effect_time = '_',
14				act_sequence = '_'
15			},
16	
17	case .ets:match_object(battle_field,Pattern) of
18		[Soldier|_] ->
19			Soldier;
20		[]->
21			none
22	end.