public LuaEventTestLogic( CommandService commandService, LuaEventService luaEventService, LuaValueMapper mapper) { this.luaEventService = luaEventService; mapper.DefineStructMapper <ExplicitStruct>(x => new LuaValue("Explicit!")); commandService.AddCommand("sendvector").Triggered += SendLuaVector; commandService.AddCommand("sendvectorlist").Triggered += SendLuaVectorList; commandService.AddCommand("senddata").Triggered += SendDataStruct; commandService.AddCommand("sendmapped").Triggered += SendLuaMappable; commandService.AddCommand("sendexplicit").Triggered += SendExplicitStruct; }
public LuaEventService(MtaServer server, RootElement root, LatentPacketService latentPacketService, IElementCollection elementCollection, LuaValueMapper mapper) { this.server = server; this.root = root; this.latentPacketService = latentPacketService; this.elementCollection = elementCollection; this.mapper = mapper; this.eventHandlers = new Dictionary <string, List <Action <LuaEvent> > >(); server.LuaEventTriggered += HandleLuaEvent; }
public LuaControllerLogic( MtaServer server, LuaEventService luaEventService, IElementCollection elementCollection, LuaValueMapper luaValueMapper) { this.server = server; this.luaEventService = luaEventService; this.elementCollection = elementCollection; this.luaValueMapper = luaValueMapper; this.handlers = new(); this.implicitlyCastableTypes = new(); IndexImplicitlyCastableTypes(); IndexControllers(); }