Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
303 | ligi | 1 | /************************************************** |
2 | * |
||
3 | * class representing the Params Structure |
||
4 | * |
||
5 | * Author: Marcus -LiGi- Bueschleb |
||
6 | * Project-Start: 9/2007 |
||
7 | * Mailto: ligi@smart4mobile.de |
||
8 | * Licence: Creative Commons / Non Commercial |
||
9 | * Big Up: Holger&Ingo |
||
10 | *************************************************/ |
||
11 | |||
12 | public class MKParamsParser |
||
13 | |||
14 | { |
||
15 | |||
314 | ligi | 16 | public final static int MAX_PARAMSETS=20; |
303 | ligi | 17 | |
314 | ligi | 18 | public int[][] field; |
19 | public String[] names={"Paramset 1","Paramset 2","Paramset 3","Paramset 4","Paramset 5"}; |
||
303 | ligi | 20 | |
314 | ligi | 21 | public int act_paramset=0; |
22 | |||
23 | |||
390 | ligi | 24 | public int get_field_from_act(int pos) |
25 | { return field[act_paramset][pos]; } |
||
314 | ligi | 26 | |
390 | ligi | 27 | public void set_field_from_act(int pos,int val) |
28 | { field[act_paramset][pos]=val; } |
||
29 | |||
30 | |||
314 | ligi | 31 | public void field_from_act_add(int pos,int val) |
32 | { |
||
33 | field[act_paramset][pos]+=val; |
||
34 | } |
||
35 | |||
36 | public void field_from_act_xor(int pos,int val) |
||
37 | { |
||
38 | field[act_paramset][pos]^=val; |
||
39 | } |
||
40 | |||
303 | ligi | 41 | public MKParamsParser() |
42 | { |
||
314 | ligi | 43 | field=new int[MAX_PARAMSETS][58]; |
44 | for (int ii=0;ii<MAX_PARAMSETS;ii++) |
||
45 | for (int i=0;i<58;i++) |
||
46 | field[ii][i]=-1; |
||
303 | ligi | 47 | |
48 | } |
||
49 | |||
314 | ligi | 50 | public void set_by_mk_data(int paramset_num,int[] in_arr,MKVersion version) |
303 | ligi | 51 | { |
52 | for ( int i=0;i<58;i++) |
||
314 | ligi | 53 | field[paramset_num][i]=in_arr[i]; |
54 | names[paramset_num]="" + (paramset_num+1) +": "; |
||
55 | for ( int i=46;i<58;i++) |
||
56 | { |
||
57 | if(in_arr[i]==0)break; |
||
58 | names[paramset_num]+=(char)in_arr[i]; |
||
59 | } |
||
303 | ligi | 60 | } |
61 | |||
62 | |||
63 | |||
64 | } |