本文整理匯總了Java中org.unbiquitous.uos.core.adaptabitilyEngine.Gateway類的典型用法代碼示例。如果您正苦於以下問題:Java Gateway類的具體用法?Java Gateway怎麽用?Java Gateway使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Gateway類屬於org.unbiquitous.uos.core.adaptabitilyEngine包,在下文中一共展示了Gateway類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: SmithyScene
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public SmithyScene(CityWorldInfo info) {
cityInfo = info;
data = PlayerData.GetData();
screen = GameComponents.get(Screen.class);
keyboard = screen.getKeyboard();
keyboard.connect(KeyboardSource.EVENT_KEY_DOWN, new Observation(this, "OnKeyDown"));
gateway = GameComponents.get(Gateway.class);
bg = assets.newSprite("img/bg/citybg.jpg");
smithyText = assets.newText(Config.WORLD_FONT, "Smithy");
smithyText.options(null, Config.WORLD_FONT_SIZE, true);
craftButton = new Button(assets, Config.BUTTON_LOOK, "Craft", Color.white,
Config.SCREEN_WIDTH / 3, Config.SCREEN_HEIGHT / 2);
viewAllButton = new Button(assets, Config.BUTTON_LOOK, "All Recipes", Color.white,
2 * Config.SCREEN_WIDTH / 3, Config.SCREEN_HEIGHT / 2);
window = null;
}
示例2: CityServer
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public CityServer() {
screen = GameComponents.get(ScreenManager.class).create();
screen.open("uRPG", 200, 100, false, Config.WINDOW_ICON);
GameComponents.put(Screen.class, screen);
keyboard = screen.getKeyboard();
keyboard.connect(KeyboardSource.EVENT_KEY_DOWN, new Observation(this, "OnKeyDown"));
data = CityData.GetData();
uRPG = assets.newText("font/seguisb.ttf", "uRPG");
cityName = assets.newText("font/seguisb.ttf", "The City of " + data.name);
pressEsc = assets.newText("font/seguisb.ttf", "Press ESC to quit");
gateway = GameComponents.get(Gateway.class);
}
示例3: AcademyScene
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public AcademyScene(CityWorldInfo info) {
cityInfo = info;
data = PlayerData.GetData();
screen = GameComponents.get(Screen.class);
keyboard = screen.getKeyboard();
keyboard.connect(KeyboardSource.EVENT_KEY_DOWN, new Observation(this, "OnKeyDown"));
gateway = GameComponents.get(Gateway.class);
bg = assets.newSprite("img/bg/citybg.jpg");
academyText = assets.newText(Config.WORLD_FONT, Classes.GetClassName(info.academyClass) + " Academy");
academyText.options(null, Config.WORLD_FONT_SIZE, true);
recruitButton = new Button(assets, Config.BUTTON_LOOK, "Recruit", Color.white,
Config.SCREEN_WIDTH / 4, Config.SCREEN_HEIGHT / 2);
promoteButton = new Button(assets, Config.BUTTON_LOOK, "Promote", Color.white,
2 * Config.SCREEN_WIDTH / 4, Config.SCREEN_HEIGHT / 2);
abilityButton = new Button(assets, Config.BUTTON_LOOK, "Learn Abilities", Color.white,
3 * Config.SCREEN_WIDTH / 4, Config.SCREEN_HEIGHT / 2);
promotion1 = Classes.GetPromotion1(info.academyClass);
promotion2 = Classes.GetPromotion2(info.academyClass);
promotion1Button = new Button(assets, Config.BUTTON_LOOK, Classes.GetClassName(promotion1), Color.white,
3 * Config.SCREEN_WIDTH / 4, Config.SCREEN_HEIGHT / 3);
promotion2Button = new Button(assets, Config.BUTTON_LOOK, Classes.GetClassName(promotion2), Color.white,
3 * Config.SCREEN_WIDTH / 4, 2 * Config.SCREEN_HEIGHT / 3);
HideButtons2();
entityWindow = null;
abilityWindow = null;
}
示例4: MarketScene
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public MarketScene(CityWorldInfo info) {
cityInfo = info;
data = PlayerData.GetData();
screen = GameComponents.get(Screen.class);
keyboard = screen.getKeyboard();
keyboard.connect(KeyboardSource.EVENT_KEY_DOWN, new Observation(this, "OnKeyDown"));
gateway = GameComponents.get(Gateway.class);
bg = assets.newSprite("img/bg/citybg.jpg");
marketText = assets.newText(Config.WORLD_FONT, "Market");
marketText.options(null, Config.WORLD_FONT_SIZE, true);
buyButton = new Button(assets, Config.BUTTON_LOOK, "Buy", Color.white,
(int) (Config.SCREEN_WIDTH * 0.33), Config.SCREEN_HEIGHT / 2);
sellButton = new Button(assets, Config.BUTTON_LOOK, "Sell", Color.white,
(int) (Config.SCREEN_WIDTH * 0.66), Config.SCREEN_HEIGHT / 2);
itemWindow = null;
transactions = null;
textInput = null;
ArrayList<Transaction> ct = RequestCompletedTransactions();
for (Transaction t : ct) {
data.gold += t.value;
TextLog.instance.Print("Successfully sold your " + Item.GetItem(t.item).GetName() + "!", Color.white);
}
}
示例5: start
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
/**
* uOS's private use.
*/
public void start(Gateway gateway, OntologyStart ontology) {
try {
init(gateway);
while (scenes.size() > 0) {
update();
}
close();
} catch (Error e) {
LOGGER.log(Level.SEVERE,"Problems while running game.",e);
}
System.exit(0);
}
示例6: init
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
@SuppressWarnings("unchecked")
protected void init(Gateway gateway) {
initImpl();
validateSettings();
GameSingletons.put(GameSettings.class, settings);
GameSingletons.put(Game.class, this);
GameSingletons.put(Gateway.class, gateway);
GameSingletons.put(DeltaTime.class, deltatime = new DeltaTime());
try {
List<Class<?>> ims = (List<Class<?>>) settings
.get("input_managers");
if (ims != null) {
for (Class<?> imc : ims) {
InputManager im = (InputManager) imc.newInstance();
GameSingletons.put(imc, im);
inputs.add(im);
}
}
List<Class<?>> oms = (List<Class<?>>) settings
.get("output_managers");
if (oms != null) {
for (Class<?> omc : oms) {
OutputManager om = (OutputManager) omc.newInstance();
GameSingletons.put(omc, om);
outputs.add(om);
}
}
scenes.add(((GameScene) ((Class<?>) settings.get("first_scene"))
.newInstance()));
} catch (Exception e) {
throw new Error(e);
}
}
示例7: KeyboardSource
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
/**
* Constructor to allocate an array of flags, for keys.
* Also setup events.
* @param ks Amount of keys.
*/
public KeyboardSource(int ks, DriverData driver) {
observations.addEvents(EVENT_KEY_DOWN, EVENT_KEY_UP);
keys = new boolean[ks];
for (int i = 0; i < ks; i++)
keys[i] = false;
dead = false;
updating = driver == null;
this.driver = driver;
registerThread = null;
unregisterThread = null;
gateway = GameSingletons.get(Gateway.class);
}
示例8: WorldMapScene
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public WorldMapScene() {
// Initialize the screen manager
screen = GameComponents.get(ScreenManager.class).create();
screen.open(Config.WINDOW_TITLE, Config.SCREEN_WIDTH,
Config.SCREEN_HEIGHT, Config.FULLSCREEN, Config.WINDOW_ICON);
GameComponents.put(Screen.class, screen);
gateway = GameComponents.get(Gateway.class);
TextLog.instance.SetAssets(assets);
CheckDayNight();
bg = assets.newSprite(Config.WORLD_BG);
data = PlayerData.GetData();
for (Entity e : data.party) {
e.LoadSprites(assets);
}
energyIcon = assets.newSprite(Config.ENERGY_ICON);
maxEnergy = PlayerData.GetMaxEnergy();
playerEnergy = assets.newText(Config.GOLD_FONT, "" + data.energy + " / " + maxEnergy);
playerEnergy.options(null, Config.GOLD_SIZE, true);
goldIcon = assets.newSprite(Config.GOLD_ICON);
playerGold = assets.newText(Config.GOLD_FONT, "");
playerGold.options(null, Config.GOLD_SIZE, true);
itemsButton = new Button(assets, Config.BUTTON_LOOK, "Inventory", Color.white,
(int) (Config.SCREEN_WIDTH / 2 - 1 * (35 + Config.BUTTON_X_WIDTH)),
(int) (Config.SCREEN_HEIGHT * 0.95));
partyButton = new Button(assets, Config.BUTTON_LOOK, "Party", Color.white,
(int) (Config.SCREEN_WIDTH / 2),
(int) (Config.SCREEN_HEIGHT * 0.95));
missionsButton = new Button(assets, Config.BUTTON_LOOK, "Missions", Color.white,
(int) (Config.SCREEN_WIDTH / 2 + 1 * (35 + Config.BUTTON_X_WIDTH)),
(int) (Config.SCREEN_HEIGHT * 0.95));
UpdateGold();
CreateRegion(EnvironmentInformation.GetSSID());
cities = new ArrayList<CityWorldInfo>();
cityButtons = new ArrayList<Button>();
lastCityRefresh = 0;
RefreshCities(true);
worldAssets = assets;
}
示例9: CityScene
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public CityScene(CityWorldInfo info) {
cityInfo = info;
data = PlayerData.GetData();
screen = GameComponents.get(Screen.class);
keyboard = screen.getKeyboard();
keyboard.connect(KeyboardSource.EVENT_KEY_DOWN, new Observation(this, "OnKeyDown"));
gateway = GameComponents.get(Gateway.class);
CheckDayNight();
bg = assets.newSprite("img/bg/citybg.jpg");
energyIcon = assets.newSprite(Config.ENERGY_ICON);
maxEnergy = (int) (Config.BASE_ENERGY * EnvironmentInformation.GetFreeSpacePercentage());
if (maxEnergy < 200) {
maxEnergy = 200;
}
energyIcon = assets.newSprite(Config.ENERGY_ICON);
maxEnergy = PlayerData.GetMaxEnergy();
goldIcon = assets.newSprite(Config.GOLD_ICON);
playerGold = assets.newText(Config.GOLD_FONT, "");
playerGold.options(null, Config.GOLD_SIZE, true);
itemsButton = new Button(assets, Config.BUTTON_LOOK, "Inventory", Color.white,
(int) (Config.SCREEN_WIDTH / 2 - 1 * (35 + Config.BUTTON_X_WIDTH)),
(int) (Config.SCREEN_HEIGHT * 0.95));
partyButton = new Button(assets, Config.BUTTON_LOOK, "Party", Color.white,
(int) (Config.SCREEN_WIDTH / 2),
(int) (Config.SCREEN_HEIGHT * 0.95));
missionsButton = new Button(assets, Config.BUTTON_LOOK, "Missions", Color.white,
(int) (Config.SCREEN_WIDTH / 2 + 1 * (35 + Config.BUTTON_X_WIDTH)),
(int) (Config.SCREEN_HEIGHT * 0.95));
UpdateGold();
CreateFacilities();
cityName = assets.newText(Config.WORLD_FONT, "The City of " + info.name);
cityName.options(null, Config.WORLD_FONT_SIZE, true);
cityAffinity = assets.newText(Config.WORLD_FONT, "Aligned with the " + info.areaName);
cityAffinity.options(null, Config.WORLD_FONT_SIZE / 2, true);
CheckEnergyRestore();
PlayerData.DiscoverCity(info.uuid, info.name);
PlayerData.Save();
playerEnergy = assets.newText(Config.GOLD_FONT, "" + data.energy + " / " + maxEnergy);
playerEnergy.options(null, Config.GOLD_SIZE, true);
for (Mission m : data.missions) {
if (m.objective == Objective.VISIT_CITY) {
VisitCityMission mm = (VisitCityMission) m;
if (mm.completed) {
continue;
}
if (mm.city.equals(info.uuid)) {
mm.completed = true;
TextLog.instance.Print("Completed a mission (visit the city of " + mm.cityName + ")", Color.white);
}
}
}
}
示例10: init
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public void init(Gateway gateway, InitialProperties properties, String instanceId) {
System.out.println("Starting up City Driver...");
}
示例11: init
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public void init(Gateway gateway, InitialProperties properties, String instanceId) {
System.out.println("Starting up User Driver...");
}
示例12: KeyboardManager
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
public KeyboardManager() {
gateway = GameSingletons.get(Gateway.class);
}
示例13: init
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
@Override
public void init(Gateway gateway, String instanceId) {
}
示例14: start
import org.unbiquitous.uos.core.adaptabitilyEngine.Gateway; //導入依賴的package包/類
@Override
public void start(Gateway gateway, OntologyStart ontology) {
}