当前位置: 首页>>代码示例>>Java>>正文


Java EventManager类代码示例

本文整理汇总了Java中net.gtaun.util.event.EventManager的典型用法代码示例。如果您正苦于以下问题:Java EventManager类的具体用法?Java EventManager怎么用?Java EventManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EventManager类属于net.gtaun.util.event包,在下文中一共展示了EventManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的net.gtaun.util.event.EventManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。