project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Scheme.java
equal
deleted
inserted
replaced
4 import java.io.File; |
4 import java.io.File; |
5 import java.io.FileNotFoundException; |
5 import java.io.FileNotFoundException; |
6 import java.io.FileReader; |
6 import java.io.FileReader; |
7 import java.io.FilenameFilter; |
7 import java.io.FilenameFilter; |
8 import java.io.IOException; |
8 import java.io.IOException; |
9 import java.io.OutputStream; |
|
10 import java.util.ArrayList; |
9 import java.util.ArrayList; |
11 import java.util.Arrays; |
10 import java.util.Arrays; |
12 import java.util.LinkedHashMap; |
11 import java.util.LinkedHashMap; |
13 |
12 |
14 import org.xmlpull.v1.XmlPullParser; |
13 import org.xmlpull.v1.XmlPullParser; |
38 |
37 |
39 public Scheme(Parcel in){ |
38 public Scheme(Parcel in){ |
40 readFromParcel(in); |
39 readFromParcel(in); |
41 } |
40 } |
42 |
41 |
43 public void sendToEngine(OutputStream os)throws IOException{ |
42 public void sendToEngine(EngineProtocolNetwork epn)throws IOException{ |
44 os.write(String.format("e$gmflags %d", gamemod).getBytes()); |
43 epn.sendToEngine(String.format("e$gmflags %d", gamemod)); |
45 |
44 |
46 for(int pos = 0; pos < basic.size(); pos++){ |
45 for(int pos = 0; pos < basic.size(); pos++){ |
47 LinkedHashMap<String, ?> basicflag = basicflags.get(pos); |
46 LinkedHashMap<String, ?> basicflag = basicflags.get(pos); |
48 |
47 |
49 String command = (String)basicflag.get("command"); |
48 String command = (String)basicflag.get("command"); |
53 Integer max = (Integer) basicflag.get("max"); |
52 Integer max = (Integer) basicflag.get("max"); |
54 |
53 |
55 if(checkOverMax && value >= max) value = max; |
54 if(checkOverMax && value >= max) value = max; |
56 if(times1000) value *= 1000; |
55 if(times1000) value *= 1000; |
57 |
56 |
58 os.write(String.format("%s %d", command, value).getBytes()); |
57 epn.sendToEngine(String.format("%s %d", command, value)); |
59 } |
58 } |
60 os.flush(); |
|
61 } |
59 } |
62 public String toString(){ |
60 public String toString(){ |
63 return name; |
61 return name; |
64 } |
62 } |
65 |
63 |