www.pudn.com > MobiCraft_src.rar > GameOptions.java
// style: tabs, tabsize=4, style=ANSI
//+----------------------------------------------------------------------+
// Copyright (c) 2006 Company Name
// Made by Andrew and Zahar
//+----------------------------------------------------------------------+
// Filename: GameOptions.java
//+----------------------------------------------------------------------+
// Comment: All options of game, is set by Menu.
//+----------------------------------------------------------------------+
package app;
import location.BuildingTypes;
import network.TPlayerOption;
import network.TMapOptions;
import network.TPCreate;
import java.io.*;
import java.util.Vector;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
public class GameOptions
{
// Присловутые 200 в оригинале
public final static int UNIT_LIMIT= 40;
public int iDifficulty;
public final int MAX_DIFF=5;
public boolean bShowDebugGUI;
public boolean bStartedFlag; // Только что запустили приложение.
public int mLanguage;
public final static int LANG_ENGLISH=1;
public final static int LANG_RUSSIAN=2;
public static final String WELCOME_MESSAGE =
"&0 Welcome to &9MobiCraft&0! \n\n" +
"&nThe Game is in &3BETA&n state\n" +
"and is still &3UNPLAYABLE&n! \n" +
"In this version You can't\n" +
"play neither single nor multiplayer games, only look over our plans.\n\n" +
" &9MobiCraft&n is absolutely\n" +
" &2FREE&n (GPL 2 or 3)\n" +
// "Like it? Please donate...\n\n" +
"Look for new versions\n" +
"on our homepage:\n" +
" &0mobicraft.wmgmag.com\n" +
" mobicraft.sf.net&n\n\n" +
" GoodLuck, HaveFun. ^_^\n\n" +
" &9MobiCraft &0Team.&n";
public final static String SHOW_VERSION="&90.5.18";
public final static int VERSION_OF_MAP_FORMAT= 42;
// Оно может быть больше чем у карты, но не наоборот
public final static int MAX_PLAYERS= 4;
// Игроки ( их может быть не более MAX_PLAYERS )
public TPlayerOption pPlayers[];
//public int nPlayers;
/* public final static int CLOSED= 0; // None player
public final static int USER= 1;
public final static int COMP_1= 2;
public final static int COMP_2= 3;
public final static int COMP_3= 4;
public final static int COMP_4= 5;
public final static int COMP_5= 6;
public final static int TOTAL= 7; // Всего вариантов. Для удобства перемотри от первого к последнему делением % на TOTAL
*/
public final static int RACE_RAND= 0; // Random, далее заменяется на выбранную случайно расу.
public final static int RACE_TERR= 1;
public final static int RACE_ZERG= 2;
public final static int RACE_TOSS= 3;
public final static int RACE_TOTAL= 4; // Всего вариантов. Для удобства перемотри от первого к последнему делением % на TOTAL
// ------------------------------------
// Типы игры.
public final static int TYPE_MELEE = 0;
public final static int TYPE_FREE_FOR_ALL = 1;
public final static int TYPE_TOTAL = 2;
public final static String[] TYPES_NAMES = { "Melee", "Free for all" };
// Скорости игры.
public final static int SPEED_SLOWEST = 0;
public final static int SPEED_SLOW = 1;
public final static int SPEED_NORMAL = 2;
public final static int SPEED_FAST = 3;
public final static int SPEED_FASTEST = 4;
public final static int SPEED_TOTAL = 5;
public final static String[] SPEEDS_NAMES = { "Slowest", "Slow", "Normal", "Fast", "Fastest" };
// ------------------------------------
// Уникальные номера игроков, которые выходят с этого телефона ( для hotseat )
public Vector vPlayersID;
// Для режима hotseat. iActivePlayer
public int iActivePlayer;
// ------------------------------------
// Созданная карта.
public TMapOptions mMap;
// Тип игры
public int iType;
public int iSpeed;
// Список игроков в комнате
//public TPCreate pCS_Players[];
// ------------------------------------
// Сколько хранить сообщений в чате ( на канале )
public final static int CHAT_MAX_MESSAGES = 50;
// Сколько мс период между обновлениями чата.
public static final int CHAT_UPDATE_PERIOD = 20000;
// Сколько мс период между обновлениями слотов в комнате.
public static final int ROOM_UPDATE_PERIOD = 20000;
public GameOptions()
{
bShowDebugGUI = false;
mLanguage = LANG_ENGLISH;
iDifficulty = 2;
bStartedFlag = true;
ResetOptions();
}
public void ResetOptions()
{
vPlayersID = new Vector();
iActivePlayer = 0;
//nPlayers = MAX_PLAYERS;
// В C++ меня бы убили, за не удаление всего в pPlayers
/*pPlayers = new TPlayerOption[MAX_PLAYERS];
for (int i=0; i