Subversion Repositories FlightCtrl

Rev

Rev 210 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
210 ligi 1
/*********************************************************************************************************************************
2
 *                                                                                                                                *
3
 * class representing the MK-Version                                                                                     *
4
 *                                                                                                                                *
5
 * Author:        Marcus -LiGi- Bueschleb                                                                                         *
6
 * Project-Start: 9/2007                                                                                                          *
7
 
8
 * Mailto:        ligi@smart4mobile.de                                                                                            *
9
 * Licence:       Creative Commons / Non Commercial                                                                               *
10
 * Big Up:        Holger&Ingo                                                                                                     *
11
 *********************************************************************************************************************************/
12
 
13
public class MKVersion
14
 
15
{
16
    public int major=-1;
17
    public int minor=-1;
18
    public int compatible=-1;
19
    public String str="--";
20
 
21
 
22
    public final byte VERSION_AFTER=0;
23
    public final byte VERSION_EQUAL=1;
24
    public final byte VERSION_PREVIOUS=2;
25
 
26
 
27
    public void set_by_mk_data(int[] data)
28
    {
29
        major=data[0];
30
        minor=data[1];
31
        compatible=data[2];
32
        str="v"+major+"."+minor+"/"+compatible;
33
    }
34
 
35
    public byte compare(int major_c,int minor_c)
36
    {
37
        if ((major_c==major)&&(minor_c==minor))
38
            return VERSION_EQUAL;
39
        // TODO - compare major - PC-COMPATIBLE
40
        else if (minor_c>minor) return VERSION_AFTER;
41
        return VERSION_PREVIOUS;
42
 
43
 
44
 
45
    }
46
 
47
}