project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/Weapon.java
author Xeli
Tue, 09 Aug 2011 20:54:56 +0200
branchhedgeroid
changeset 5508 dcf1b3645af6
parent 5463 83c53a80f7ff
child 5621 ea796c83ea47
permissions -rw-r--r--
Fixed IPC provide gameconfig
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
     1
package org.hedgewars.mobile.EngineProtocol;
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     2
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     3
import java.io.BufferedReader;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     4
import java.io.File;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     5
import java.io.FileNotFoundException;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     6
import java.io.FileReader;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     7
import java.io.IOException;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     8
import java.util.ArrayList;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
     9
import java.util.Arrays;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    10
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    11
import org.xmlpull.v1.XmlPullParser;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    12
import org.xmlpull.v1.XmlPullParserException;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    13
import org.xmlpull.v1.XmlPullParserFactory;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    14
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    15
import android.content.Context;
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    16
import android.os.Parcel;
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    17
import android.os.Parcelable;
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    18
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    19
public class Weapon implements Parcelable{
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    20
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    21
	public static final String DIRECTORY_WEAPON = "weapons";
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    22
	
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    23
	private String name;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    24
	private String QT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    25
	private String prob;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    26
	private String delay;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    27
	private String crate;
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    28
	private static int maxWeapons;
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    29
	
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    30
	static{
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    31
		//maxWeapons = PascalExports.HWgetNumberOfWeapons();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    32
	}
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    33
	
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    34
	public Weapon(String _name, String _QT, String _prob, String _delay, String _crate){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    35
		name = _name;
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    36
		
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    37
		//Incase there's a newer ammoStore which is bigger we append with zeros
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    38
		StringBuffer sb = new StringBuffer();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    39
		while(_QT.length() + sb.length() < maxWeapons){
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    40
			sb.append('0');
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    41
		}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    42
		
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    43
		QT = String.format("e%s %s%s", "ammloadt", _QT, sb);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    44
		prob = String.format("e%s %s%s", "ammprob", _prob, sb);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    45
		delay = String.format("e%s %s%s", "ammdelay", _delay, sb);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    46
		crate = String.format("e%s %s%s", "ammreinf", _crate, sb);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    47
	}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    48
	
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    49
	public Weapon(Parcel in){
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    50
		readFromParcel(in);
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    51
	}
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    52
	
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    53
	public String toString(){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    54
		return name;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    55
	}
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    56
	
5508
dcf1b3645af6 Fixed IPC provide gameconfig
Xeli
parents: 5463
diff changeset
    57
	public void sendToEngine(EngineProtocolNetwork epn, int teamsCount) throws IOException{
dcf1b3645af6 Fixed IPC provide gameconfig
Xeli
parents: 5463
diff changeset
    58
		epn.sendToEngine(QT);//command prefix is already in string 
dcf1b3645af6 Fixed IPC provide gameconfig
Xeli
parents: 5463
diff changeset
    59
		epn.sendToEngine(prob);
dcf1b3645af6 Fixed IPC provide gameconfig
Xeli
parents: 5463
diff changeset
    60
		epn.sendToEngine(delay);
dcf1b3645af6 Fixed IPC provide gameconfig
Xeli
parents: 5463
diff changeset
    61
		epn.sendToEngine(crate);
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    62
		
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    63
		for(int i = 0; i < teamsCount; i++){
5508
dcf1b3645af6 Fixed IPC provide gameconfig
Xeli
parents: 5463
diff changeset
    64
			epn.sendToEngine("eammstore");
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    65
		}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    66
	}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    67
	
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    68
	public static final int STATE_START = 0;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    69
	public static final int STATE_ROOT = 1;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    70
	public static final int STATE_NAME = 2;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    71
	public static final int STATE_QT = 3;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    72
	public static final int STATE_PROBABILITY = 4;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    73
	public static final int STATE_DELAY = 5;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    74
	public static final int STATE_CRATE = 6;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    75
	
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
    76
	public static ArrayList<Weapon> getWeapons(Context c) throws IllegalArgumentException{
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    77
		String dir = c.getFilesDir().getAbsolutePath() + '/' + DIRECTORY_WEAPON + '/';
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    78
		String[] files = new File(dir).list();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    79
		if(files == null) files = new String[]{};
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    80
		Arrays.sort(files);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    81
		
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    82
		ArrayList<Weapon> weapons = new ArrayList<Weapon>();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    83
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    84
		try {
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    85
			XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    86
			XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    87
			
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    88
			for(String file : files){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    89
				BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    90
				xmlPuller.setInput(br);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    91
				String name = null;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    92
				String qt = null;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    93
				String prob = null;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    94
				String delay = null;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    95
				String crate = null;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    96
				
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    97
				int eventType = xmlPuller.getEventType();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    98
				int state = STATE_START;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
    99
				while(eventType != XmlPullParser.END_DOCUMENT){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   100
					switch(state){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   101
					case STATE_START:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   102
						if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("weapon")) state = STATE_ROOT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   103
						else if(eventType != XmlPullParser.START_DOCUMENT) throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   104
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   105
					case STATE_ROOT:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   106
						if(eventType == XmlPullParser.START_TAG){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   107
							if(xmlPuller.getName().toLowerCase().equals("qt")) state = STATE_QT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   108
							else if(xmlPuller.getName().toLowerCase().equals("name")) state = STATE_NAME;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   109
							else if(xmlPuller.getName().toLowerCase().equals("probability")) state = STATE_PROBABILITY;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   110
							else if(xmlPuller.getName().toLowerCase().equals("delay")) state = STATE_DELAY;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   111
							else if(xmlPuller.getName().toLowerCase().equals("crate")) state = STATE_CRATE;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   112
							else throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   113
						}else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   114
						else throwException(xmlPuller.getText(), eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   115
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   116
					case STATE_NAME:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   117
						if(eventType == XmlPullParser.TEXT) name = xmlPuller.getText().trim();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   118
						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   119
						else throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   120
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   121
					case STATE_QT:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   122
						if(eventType == XmlPullParser.TEXT) qt = xmlPuller.getText().trim();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   123
						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   124
						else throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   125
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   126
					case STATE_PROBABILITY:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   127
						if(eventType == XmlPullParser.TEXT) prob = xmlPuller.getText().trim();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   128
						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   129
						else throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   130
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   131
					case STATE_DELAY:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   132
						if(eventType == XmlPullParser.TEXT) delay = xmlPuller.getText().trim();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   133
						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   134
						else throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   135
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   136
					case STATE_CRATE:
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   137
						if(eventType == XmlPullParser.TEXT) crate = xmlPuller.getText().trim();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   138
						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   139
						else throwException(file, eventType);
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   140
						break;
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   141
					}
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   142
					eventType = xmlPuller.next();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   143
					while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){//Skip whitespaces
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   144
						eventType = xmlPuller.next();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   145
					}
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   146
				}//end while(eventtype != END_DOCUMENT
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   147
				weapons.add(new Weapon(name, qt, prob, delay, crate));
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   148
			}//end for(string file : files
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   149
			return weapons;
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   150
			
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   151
		} catch (XmlPullParserException e) {
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   152
			e.printStackTrace();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   153
		} catch (FileNotFoundException e) {
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   154
			e.printStackTrace();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   155
		} catch (IOException e) {
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   156
			e.printStackTrace();
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   157
		}
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   158
		return new ArrayList<Weapon>();//TODO handle correctly
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   159
	}
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   160
	
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   161
	private static void throwException(String file, int eventType){
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   162
		throw new IllegalArgumentException(String.format("Xml file: %s malformed with eventType: %d.", file, eventType));
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   163
	}
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   164
5463
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   165
	public int describeContents() {
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   166
		return 0;
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   167
	}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   168
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   169
	public void writeToParcel(Parcel dest, int flags) {
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   170
		dest.writeString(name);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   171
		dest.writeString(QT);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   172
		dest.writeString(prob);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   173
		dest.writeString(delay);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   174
		dest.writeString(crate);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   175
	}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   176
	
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   177
	private void readFromParcel(Parcel src){
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   178
		name = src.readString();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   179
		QT = src.readString();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   180
		prob = src.readString();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   181
		delay = src.readString();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   182
		crate = src.readString();
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   183
	}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   184
	
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   185
	public static final Parcelable.Creator<Weapon> CREATOR = new Parcelable.Creator<Weapon>() {
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   186
		public Weapon createFromParcel(Parcel source) {
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   187
			return new Weapon(source);
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   188
		}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   189
		public Weapon[] newArray(int size) {
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   190
			return new Weapon[size];
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   191
		}
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   192
		
83c53a80f7ff datastructures for the different aspects of a gameconfiguration
Xeli
parents: 5433
diff changeset
   193
	};
5433
8f82045953c1 Main class files for the start-local-game screen
Xeli
parents:
diff changeset
   194
}