本文整理汇总了Java中net.gtaun.util.event.EventManager类的典型用法代码示例。如果您正苦于以下问题:Java EventManager类的具体用法?Java EventManager怎么用?Java EventManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventManager类属于net.gtaun.util.event包,在下文中一共展示了EventManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onEnable
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
@Override
protected void onEnable() throws Throwable {
instance = this;
EventManager eventManager = getEventManager();
eventManagerNode = eventManager.createChildNode();
playerLifecycleHolder = new PlayerLifecycleHolder(eventManager);
playerLifecycleHolder.registerClass(PlayerData.class);
playerManager = new PlayerManager();
languageService = Service.get(LanguageService.class);
localizedStringSet = languageService.createStringSet(new File(getDataDir(), "lang"));
//TODO: init EventMapBase
//TODO: init EventBase
EventNPCBase.initialize();
chat = new Chat();
System.out.println("[EVENT] initialized");
}
开发者ID:Alf21,项目名称:event-system,代码行数:17,代码来源:EventSystem.java
示例2: PlayerData
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public PlayerData(EventManager manager, Player p) {
super(manager, p);
player = p;
vehicleHealth = -1;
eventPoints = 0;
eventScore = 0;
playerWeapons = new ArrayList<>();
color = new Color(0,0,0,0);
lastUpdate = 0;
damage = 0;
aFK = false;
health = 100f;
armour = 0f;
traitorShop = new HashMap<>();
rangeLabels = new ArrayList<>();
}
开发者ID:Alf21,项目名称:event-system,代码行数:17,代码来源:PlayerData.java
示例3: create
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public static WlInputDialog create(Player player, EventManager eventManager, AbstractDialog parent, String caption, String message, RaceServiceImpl raceService, BiConsumer<WlInputDialog, String> namingHandler)
{
PlayerStringSet stringSet = raceService.getLocalizedStringSet().getStringSet(player);
return WlInputDialog.create(player, eventManager)
.parentDialog(parent)
.caption(caption)
.message(message)
.onClickOk((d, text) ->
{
player.playSound(1083);
String name = TrackUtils.filterName(text);
if (TrackUtils.isVaildName(name) == false)
{
((WlInputDialog) d).setAppendMessage(stringSet.format("Dialog.TrackNamingDialog.IllegalLengthAppendMessage", TrackUtils.NAME_MIN_LENGTH, TrackUtils.NAME_MAX_LENGTH));
d.show();
return;
}
namingHandler.accept((WlInputDialog) d, name);
})
.build();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:24,代码来源:TrackNamingDialog.java
示例4:
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public TrackListDialog
(Player player, EventManager eventManager, AbstractDialog parent, RaceServiceImpl service, List<Track> tracks)
{
super(player, eventManager);
setParentDialog(parent);
this.raceService = service;
this.tracks = tracks;
statusFilters = new ArrayList<>();
statusFilters.add(TrackUtils.FILTER_COMPLETED);
statusFilters.add(TrackUtils.FILTER_RANKING);
statusFilters.add(TrackUtils.FILTER_EDITING);
statusFilter = statusFilters.get(0);
trackComparators = new ArrayList<>();
trackComparators.add(TrackUtils.createNearestComparator(player.getLocation()));
trackComparators.add(TrackUtils.COMPARATOR_LENGTH_LONGTOSHORT);
trackComparators.add(TrackUtils.COMPARATOR_LENGTH_SHORTTOLONG);
trackComparator = trackComparators.get(0);
update();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:23,代码来源:TrackListDialog.java
示例5:
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public static WlMsgboxDialog create
(Player player, EventManager eventManager, AbstractDialog parent, RaceServiceImpl service, Racing racing, Runnable startRacingCallback)
{
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
return WlMsgboxDialog.create(player, eventManager)
.parentDialog(parent)
.caption(stringSet.get("Dialog.NewRacingConfirmDialog.Caption"))
.message(stringSet.format("Dialog.NewRacingConfirmDialog.Text", racing.getName()))
.onClickOk((d) ->
{
player.playSound(1083);
racing.leave(player);
startRacingCallback.run();
})
.build();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:17,代码来源:NewRacingConfirmDialog.java
示例6: Racing
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
Racing(EventManager rootEventManager, RaceServiceImpl raceService, RacingManagerImpl racingManager, Track track, Player sponsor, String name)
{
super(rootEventManager);
this.raceService = raceService;
this.manager = racingManager;
this.track = track;
this.sponsor = sponsor;
this.name = name;
setting = new RacingSetting(track);
players = new ArrayList<>();
finishedPlayers = new ArrayList<>();
playerContents = new HashMap<>();
status = RacingStatus.WAITING;
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:19,代码来源:Racing.java
示例7: onEnable
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
@Override
protected void onEnable() throws Throwable {
instance = this;
EventManager eventManager = getEventManager();
eventManagerNode = eventManager.createChildNode();
playerLifecycleHolder = new PlayerLifecycleHolder(eventManager);
playerLifecycleHolder.registerClass(PlayerData.class);
playerManager = new PlayerManager();
playersTextdraws = new ArrayList<>();
playerTextdraws = new ArrayList<>();
System.out.println("[TEXTDRAWSYSTEM] initialized");
}
开发者ID:Alf21,项目名称:textdraw-system,代码行数:13,代码来源:TextdrawSystem.java
示例8: PlayerData
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public PlayerData(EventManager manager, Player p) {
super(manager, p);
player = p;
count = 0L;
timer = Timer.create(UPDATE_DELAY, (factualInterval) -> {
VehicleFunctions.onTimer(this, VehicleSystem.getVehicleData(p));
count++;
});
}
开发者ID:Alf21,项目名称:vehicle-system,代码行数:10,代码来源:PlayerData.java
示例9: RacingDialog
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public RacingDialog(Player player, EventManager eventManager, AbstractDialog parent, RaceServiceImpl service, Racing racing)
{
super(player, eventManager);
setParentDialog(parent);
this.raceService = service;
this.racing = racing;
this.stringSet = service.getLocalizedStringSet().getStringSet(player);
setCaption(() -> stringSet.format("Dialog.RacingDialog.Caption", racing.getName()));
setClickOkHandler((d, i) -> player.playSound(1083));
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:13,代码来源:RacingDialog.java
示例10: TrackEditDialog
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public TrackEditDialog(Player player, EventManager eventManager, AbstractDialog parent, RaceServiceImpl service, Track track)
{
super(player, eventManager);
setParentDialog(parent);
this.raceService = service;
this.track = track;
stringSet = service.getLocalizedStringSet().getStringSet(player);
setCaption(() -> stringSet.format("Dialog.TrackEditDialog.Caption", track.getName()));
setClickOkHandler((d, i) -> player.playSound(1083));
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:14,代码来源:TrackEditDialog.java
示例11: CodeEditorDialog
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public CodeEditorDialog(Player player, EventManager eventManager, AbstractDialog parent, RaceServiceImpl service, String title, String code, Consumer<String> onCompleteHandler)
{
super(player, eventManager);
setParentDialog(parent);
this.onCompleteHandler = onCompleteHandler;
if (code == null) code = "";
codeLines = new ArrayList<>(Arrays.asList(StringUtils.split(code, '\n')));
stringSet = service.getLocalizedStringSet().getStringSet(player);
setCaption(() -> stringSet.format("Dialog.CodeEditorDialog.Caption", title, codeLines.size()));
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:14,代码来源:CodeEditorDialog.java
示例12: RacingPlayerContentImpl
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public RacingPlayerContentImpl(EventManager rootEventManager, Player player, RaceServiceImpl raceService, final Racing racing, TrackCheckpoint startCheckpoint)
{
super(rootEventManager, player);
this.raceService = raceService;
this.racing = racing;
this.currentCheckpoint = startCheckpoint;
this.mapIcons = new HashMap<>();
vehicleManagerLimit = new PlayerOverrideLimit()
{
@Override
public boolean isInfiniteNitrous(boolean previous)
{
return previous && racing.getSetting().getLimit().isAllowInfiniteNitrous();
}
@Override
public boolean isAutoRepair(boolean previous)
{
return previous && racing.getSetting().getLimit().isAllowAutoRepair();
}
@Override
public boolean isAutoFlip(boolean previous)
{
return previous && racing.getSetting().getLimit().isAllowAutoFlip();
}
@Override
public boolean isAutoCarryPassengers(boolean previous)
{
return previous;
}
};
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:36,代码来源:RacingPlayerContentImpl.java
示例13: RacingHudWidget
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public RacingHudWidget(EventManager rootEventManager, RaceServiceImpl raceService, Player player, RacingPlayerContent racingPlayerContext)
{
super(rootEventManager, player);
this.raceService = raceService;
this.racingPlayerContext = racingPlayerContext;
progressBarTextdraws = new ArrayList<>();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:8,代码来源:RacingHudWidget.java
示例14: RacingManagerImpl
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public RacingManagerImpl(EventManager rootEventManager, RaceServiceImpl raceService, Datastore datastore)
{
super(rootEventManager);
this.raceService = raceService;
racings = new ArrayList<>();
playerRacings = new HashMap<>();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:9,代码来源:RacingManagerImpl.java
示例15: TrackEditor
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public TrackEditor(EventManager rootEventManager, Player player, RaceServiceImpl raceService, Track track)
{
super(rootEventManager, player);
this.raceService = raceService;
this.track = track;
this.mapIcons = new HashMap<>();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:8,代码来源:TrackEditor.java
示例16: RaceServiceImpl
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public RaceServiceImpl(EventManager rootEventManager, RacePlugin plugin, Datastore datastore)
{
super(rootEventManager);
this.plugin = plugin;
playerLifecycleHolder = new PlayerLifecycleHolder(eventManagerNode);
LanguageService languageService = Service.get(LanguageService.class);
localizedStringSet = languageService.createStringSet(new File(plugin.getDataDir(), "text"));
trackManager = new TrackManagerImpl(datastore);
racingManager = new RacingManagerImpl(eventManagerNode, this, datastore);
init();
}
开发者ID:GTAUN,项目名称:wl-race,代码行数:16,代码来源:RaceServiceImpl.java
示例17: VehicleManagerServiceImpl
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public VehicleManagerServiceImpl(EventManager rootEventManager, VehicleManagerPlugin plugin, Datastore datastore)
{
super(rootEventManager);
this.plugin = plugin;
this.datastore = datastore;
eventManager = rootEventManager.createChildNode();
playerLifecycleHolder = new PlayerLifecycleHolder(eventManager);
LanguageService languageService = Service.get(LanguageService.class);
localizedStringSet = languageService.createStringSet(new File(plugin.getDataDir(), "text"));
statisticManager = new VehicleStatisticManager(eventManager, playerLifecycleHolder, this.datastore);
playerOwnedVehicles = new HashMap<>();
ownedVehicles = new HashSet<>();
playerOwnedVehicleLastPassengers = new WeakHashMap<>();
commonVehicles = new HashMap<>();
File commonVehiclesFile = new File(plugin.getDataDir(), "commonVehicles.yml");
try
{
Map<String, Object> map = (Map<String, Object>) new Yaml().load(new FileInputStream(commonVehiclesFile));
List<Map<String, Object>> vehicleGroups = (List<Map<String,Object>>) map.get("commonVehicles");
for (Map<String, Object> group : vehicleGroups)
{
String name = group.get("name").toString();
List<Integer> modelIds = (List<Integer>) group.get("modelIds");
commonVehicles.put(name, modelIds);
}
}
catch (Throwable e)
{
VehicleManagerPlugin.LOGGER.info(commonVehiclesFile + " failed to load!");
}
init();
}
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:41,代码来源:VehicleManagerServiceImpl.java
示例18:
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public static WlListDialog create
(Player player, EventManager eventManager, AbstractDialog parent, Vehicle vehicle, VehicleManagerServiceImpl service, VehicleComponentSlot slot)
{
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
int modelId = vehicle.getModelId();
String name = VehicleModel.getName(modelId);
Set<Integer> components = VehicleComponentModel.getSlotSupportedComponents(modelId, slot);
String slotName = VehicleTextUtils.getComponentSlotName(stringSet, slot);
return WlListDialog.create(player, eventManager)
.parentDialog(parent)
.caption(stringSet.format("Dialog.VehicleComponentAddDialog.Caption", name, slotName))
.execute((b) ->
{
for (int cid : components)
{
String componentName = VehicleComponentModel.getName(cid);
String itemText = stringSet.format("Dialog.VehicleComponentAddDialog.Item", slotName, componentName);
// XXX: Buggy Eclipse JDT Compiler
((AbstractListDialogBuilder<?,?>) b).item(itemText, (i) ->
{
stringSet.sendMessage(Color.LIGHTBLUE, "Dialog.VehicleComponentAddDialog.AddMessage", name, slotName, componentName);
vehicle.getComponent().add(cid);
});
}
})
.onClickOk((d, i) ->
{
player.playSound(1133);
d.showParentDialog();
})
.build();
}
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:37,代码来源:VehicleComponentAddDialog.java
示例19: EmptyVehicleListDialog
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public EmptyVehicleListDialog(Player player, EventManager eventManager, AbstractDialog parent, VehicleManagerServiceImpl service, Comparator<Vehicle> comparator, Predicate<Vehicle> filter)
{
super(player, eventManager);
setParentDialog(parent);
this.service = service;
this.comparator = comparator;
this.filter = filter;
this.stringSet = service.getLocalizedStringSet().getStringSet(player);
setCaption(() -> stringSet.format("Dialog.EmptyVehicleListDialog.Caption", getCurrentPage() + 1, getMaxPage() + 1));
}
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:13,代码来源:EmptyVehicleListDialog.java
示例20: DrivingRecordStatisticDialog
import net.gtaun.util.event.EventManager; //导入依赖的package包/类
public DrivingRecordStatisticDialog(Player player, EventManager eventManager, AbstractDialog parent, VehicleManagerServiceImpl service)
{
super(player, eventManager);
setParentDialog(parent);
PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
setCaption(stringSet.get("Dialog.DrivingRecordStatisticDialog.Caption"));
service.getPlayerRecordedOnceStatistics(player).forEach((stat) ->
{
List<Integer> modelIds = stat.getModelIds();
int modelId = modelIds.get(0);
String modelName = modelIds.size() == 1 ? VehicleModel.getName(modelId) : stringSet.get("Statistic.MoveWay.Multiple");
String startTimeStr = DateFormatUtils.ISO_TIME_NO_T_FORMAT.format(stat.getStartTime());
String endTimeStr = stringSet.get("Time.NA");
Date endTime = stat.getEndTime();
if (endTime != null) endTimeStr = DateFormatUtils.ISO_TIME_NO_T_FORMAT.format(stat.getEndTime());
String type;
switch (stat.getType())
{
case DRIVER: type = stringSet.get("Statistic.Type.Driver"); break;
case PASSENGER: type = stringSet.get("Statistic.Type.Passenger"); break;
case RACING: type = stringSet.get("Statistic.Type.Racing"); break;
default: type = stringSet.get("Statistic.Type.Unknown"); break;
}
String item = stringSet.format("Dialog.DrivingRecordStatisticDialog.Item", type, modelName, modelId, startTimeStr, endTimeStr);
addItem(item, (i) ->
{
OnceStatisticDialog.create(player, eventManager, this, service, stat).show();
});
});
}
开发者ID:GTAUN,项目名称:wl-vehicle-manager,代码行数:36,代码来源:DrivingRecordStatisticDialog.java
注:本文中的net.gtaun.util.event.EventManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论