Rev 255 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
220 | ligi | 1 | /************************************************** |
2 | * |
||
3 | * class representing the Params Structure |
||
4 | * |
||
5 | * Author: Marcus -LiGi- Bueschleb |
||
6 | * |
||
7 | * see README for further Infos |
||
8 | * |
||
9 | *************************************************/ |
||
10 | |||
11 | package org.ligi.ufo; |
||
12 | |||
13 | |||
14 | |||
15 | public abstract class ParamsClass |
||
16 | implements MKParamDefinitions |
||
17 | { |
||
18 | |||
258 | ligi | 19 | public int[] tab_stringids; |
20 | public int[][] choice_stringids; |
||
21 | public int[][] field_stringids; |
||
255 | ligi | 22 | // public String[] tab_names; |
258 | ligi | 23 | //- public String[][] field_names; |
220 | ligi | 24 | public int[][] field_positions; |
25 | public int[][] field_types; |
||
258 | ligi | 26 | //- public String[][] choice_strings; |
220 | ligi | 27 | |
28 | abstract public int get_field_from_act(int pos); |
||
29 | |||
30 | |||
31 | abstract public void set_field_from_act(int pos,int val); |
||
32 | |||
33 | |||
252 | ligi | 34 | public void field_from_act_add_min_max(int pos,int val,int min,int max) |
35 | { |
||
36 | if (((get_field_from_act(pos)+val)>=min)&&((get_field_from_act(pos)+val)<=max)) |
||
37 | set_field_from_act(pos , get_field_from_act(pos)+val); |
||
38 | } |
||
39 | |||
220 | ligi | 40 | public void field_from_act_add(int pos,int val) |
41 | { |
||
42 | set_field_from_act(pos , get_field_from_act(pos)+val); |
||
43 | } |
||
44 | |||
45 | public void field_from_act_add_mod(int pos,int val,int mod) |
||
46 | { |
||
47 | int res=(get_field_from_act(pos)+val)%mod; |
||
48 | if ( (res)<0) res=mod-1; |
||
49 | |||
50 | set_field_from_act(pos , res); |
||
51 | } |
||
52 | |||
53 | public void field_from_act_xor(int pos,int val) |
||
54 | { |
||
55 | set_field_from_act(pos , get_field_from_act(pos)^val); |
||
56 | } |
||
57 | |||
58 | } |