How to use registerevent method in pyatom

Best Python code snippet using pyatom_python

vehicleMarkersBC.py

Source:vehicleMarkersBC.py Github

copy

Full Screen

1""" XVM (c) https://modxvm.com 2013-2020 """2#####################################################################3# imports4from gui.Scaleform.daapi.view.battle.shared.stats_exchage import BattleStatisticsDataController5from xfw import *6from vehicleMarkers import g_markers7#####################################################################8# constants9class BC(object):10 setVehiclesData = 'BC_setVehiclesData'11 addVehiclesInfo = 'BC_addVehiclesInfo'12 updateVehiclesData = 'BC_updateVehiclesData'13 updateVehicleStatus = 'BC_updateVehicleStatus'14 updatePlayerStatus = 'BC_updatePlayerStatus'15 setFrags = 'BC_setFrags'16 updateVehiclesStat = 'BC_updateVehiclesStat'17 updatePersonalStatus = 'BC_updatePersonalStatus'18 setUserTags = 'BC_setUserTags'19 updateUserTags = 'BC_updateUserTags'20 setPersonalStatus = 'BC_setPersonalStatus'21 updateInvitationsStatuses = 'BC_updateInvitationsStatuses'22#####################################################################23# initialization/finalization24@registerEvent(BattleStatisticsDataController, 'as_setVehiclesDataS')25def as_setVehiclesDataS(self, data):26 g_markers.call(BC.setVehiclesData, data)27@registerEvent(BattleStatisticsDataController, 'as_addVehiclesInfoS')28def as_addVehiclesInfoS(self, data):29 g_markers.call(BC.addVehiclesInfo, data)30@registerEvent(BattleStatisticsDataController, 'as_updateVehiclesInfoS')31def as_updateVehiclesInfoS(self, data):32 g_markers.call(BC.updateVehiclesData, data)33@registerEvent(BattleStatisticsDataController, 'as_updateVehicleStatusS')34def as_updateVehicleStatusS(self, data):35 g_markers.call(BC.updateVehicleStatus, data)36@registerEvent(BattleStatisticsDataController, 'as_updatePlayerStatusS')37def as_updatePlayerStatusS(self, data):38 g_markers.call(BC.updatePlayerStatus, data)39@registerEvent(BattleStatisticsDataController, 'as_setFragsS')40def as_setFragsS(self, data):41 g_markers.call(BC.setFrags, data)42@registerEvent(BattleStatisticsDataController, 'as_updateVehiclesStatsS')43def as_updateVehiclesStatsS(self, data):44 g_markers.call(BC.updateVehiclesStat, data)45@registerEvent(BattleStatisticsDataController, 'as_updatePersonalStatusS')46def as_updatePersonalStatusS(self, added, removed):47 g_markers.call(BC.updatePersonalStatus, added, removed)48@registerEvent(BattleStatisticsDataController, 'as_setUserTagsS')49def as_setUserTagsS(self, data):50 g_markers.call(BC.setUserTags, data)51@registerEvent(BattleStatisticsDataController, 'as_updateUserTagsS')52def as_updateUserTagsS(self, data):53 g_markers.call(BC.updateUserTags, data)54@registerEvent(BattleStatisticsDataController, 'as_setPersonalStatusS')55def as_setPersonalStatusS(self, data):56 g_markers.call(BC.setPersonalStatus, data)57@registerEvent(BattleStatisticsDataController, 'as_updateInvitationsStatusesS')58def as_updateInvitationsStatusesS(self, data):...

Full Screen

Full Screen

EventManager.py

Source:EventManager.py Github

copy

Full Screen

1class EventManager:2 3 Events = {}4 5 # add events users can listen to6 @staticmethod7 def registerEvent(event):8 EventManager.Events[event] = []9 10 # define all events11 @staticmethod12 def initEvents():13 14 EventManager.registerEvent("GameStarting")15 EventManager.registerEvent("GameStarted")16 17 EventManager.registerEvent("GameFinished")18 19 EventManager.registerEvent("MoveBegan")20 EventManager.registerEvent("MoveDenied")21 EventManager.registerEvent("MoveFinished")22 23 EventManager.registerEvent("PlayerChanged")24 25 EventManager.registerEvent("GameUILoaded")26 27 EventManager.registerEvent("UITick")28 29 EventManager.registerEvent("ToggleVictoryPath")30 31 # add subscriber to the specific events32 @staticmethod33 def subscribe(event, callback):34 EventManager.Events[event].append(callback)35 36 # called to notify all subscribers37 @staticmethod38 def notify(event):39 for func in EventManager.Events[event]:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pyatom automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful