public void FillData() { EventLibrary.LoadLibrary(Path.Combine(Program.DictonariesDir, "EventLibrary.json")); SkillLibrary.FillData(); TazunaLibrary.LoadLibrary(Path.Combine(Program.DictonariesDir, "TazunaLibrary.json")); FactorLibrary.FillData(); MissionLibrary.FillData(); FreeShopLibrary.FillData(); }
void Setup() { _state = EventState.Prologue; _food = 5; _wisdom = 0; currentInterval = 0; events = GetComponent <EventLibrary>(); CurrentEncounter = events.Prologue; }
public static WorldData EncodeWorldData(ObjectManager manager, EventLibrary library) { string ids = ""; foreach (IHasState obj in manager.GetObjects()) ids += ((Component)obj).gameObject.name + ": " + obj.Id + "\n"; Debug.Log(ids); StateData initialState = new StateData( new WorldState( manager.GetObjects().Cast<IHasState>())); EventData[] events = library.GetSignatures().Convert(s => new EventData(s)).ToArray(); return new WorldData(initialState, events); }
public static async Task Main(string[] args) { var containerBuilder = new ContainerBuilder(); containerBuilder.RegisterType <ThreadGreeter>().As <IThreadGreeter>(); containerBuilder.ConfigureMasstransit(); var container = containerBuilder.Build(); var busControl = container.Resolve <IBusControl>(); busControl.ConnectReceiveObserver(new AnObserver()); Console.WriteLine("Starting bus"); await busControl.StartAsync(); Console.WriteLine("Bus has started"); string command = string.Empty; while (!command.Equals("q", StringComparison.InvariantCultureIgnoreCase)) { var availableActions = EventLibrary.GetEventDefintion(); availableActions.ToList().ForEach(a => Console.WriteLine(a.ToString())); Console.WriteLine("Please enter a command:"); command = Console.ReadLine(); if (command.Equals("q", StringComparison.InvariantCultureIgnoreCase)) { break; } var eventDefinition = availableActions.FirstOrDefault(p => p.Id == int.Parse(command)); await busControl.Publish(eventDefinition.Event); } Console.WriteLine("Goodbye!"); }
void Awake() { this.Initialize(); EventLibrary.instance = this; }
public EventSystemImpl(EventLibrary eventLibrary, NetworkSystem networkSystem) { this.mainThread = Thread.CurrentThread; this.eventLibrary = eventLibrary; this.networkSystem = networkSystem; }