private ulong CreateInteraction(long type, long id, Vector3 position, int dimension, int range) { Interaction interaction = new Interaction((ulong)type, (ulong)id, position, dimension, (uint)range); AltInteractions.AddInteraction(interaction); interactions.Add($"{type}_{id}", interaction); return(interaction.Id); }
public void AddTest() { var position = GetRandomVector3(); var entity = new Interaction(1, 1, position, 0, 1); AltInteractions.AddInteraction(entity); var task = AltInteractions.FindInteractions(position, 0); task.Wait(); var interactions = task.Result; Assert.AreEqual(1, interactions.Length); Assert.AreEqual(entity, interactions[0]); }
public async Task OnStartup() { var data = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "data", "dumps", "objectslocations", "worldAtms.json")); var allAtms = JsonConvert.DeserializeObject <List <WorldAtmObject> >(data); foreach (var atm in allAtms) { var interaction = new AtmInteraction((ulong)_interactions.Count, atm.Position, 0, 2); _interactions.Add(interaction); AltInteractions.AddInteraction(interaction); } await Task.CompletedTask; }