public AdjacentLocation(LocationNames location, bool locCovered, int number) { switch (location) { case LocationNames.ABOVE_CENTER: case LocationNames.ABOVE_LEFT: case LocationNames.ABOVE_RIGHT: yOffSet = 1; break; case LocationNames.BELOW_CENTER: case LocationNames.BELOW_LEFT: case LocationNames.BELOW_RIGHT: yOffSet = -1; break; } switch (location) { case LocationNames.ABOVE_LEFT: case LocationNames.LEFT: case LocationNames.BELOW_LEFT: xOffSet = -1; break; case LocationNames.ABOVE_RIGHT: case LocationNames.RIGHT: case LocationNames.BELOW_RIGHT: xOffSet = 1; break; } covered = locCovered; unitNumber = number; }
public EDJournalMonitor(CancellationToken shutdown) { Settings.Instance.SettingChange += HandleSettingChange; Location = new LocationNames(); Shutdown = shutdown; InitJournalFiles(); }
public static string AttemptTranslate(ByteArrayStream stream, int depthLeft = 2) { var code = stream.Byte(); if (code >= 0x80) { return(BasicTable.Lookup(code)); } if (code < 0x30) { if (code == 0x01) { return($"{{windowbreak}}"); } if (code == 0x05) { return($"{{05:{stream.Byte().ToString("x2")}}}"); } if (code == 0x1b) { return($"{{swapspeaker:{stream.Byte().ToString("x2")}}}"); } if (code == 0x1d) { return($"{{character:{CharacterNames.GetString(stream.Byte())}}}"); } if (code == 0x1e) { return($"{{item:{ItemNames.GetString(stream.Byte())}}}"); } if (code == 0x1f) { return($"{{location:{LocationNames.GetString(stream.Byte())}}}"); } //if (code == 0x2f) { // return $"{{if:{stream.Byte().ToString("x2")} {stream.Byte().ToString("x2")} {stream.Byte().ToString("x2")}}}"; //} return($"{{{code.ToString("x2")}}}"); } if (depthLeft == 0) { return($"{{{code.ToString("x2")}}}"); } //var text = string.Join("", LookupBytes(code).Select(x => AttemptTranslate(x, depthLeft - 1))); var text = AttemptTranslateLine(LookupBytes(code), depthLeft - 1); return(text); }
public static Vector3 GetPositionFromLocation(LocationNames locationNames) { Vector3 rv; var hasSucceeded = LocationAndPosition.TryGetValue(locationNames, out rv); if (!hasSucceeded) { Debug.Log("Failed to get location from a position"); return(Vector3.zero); } return(rv); }
public void AddLocation([NotNull] CalcLocationDto calcloc) { LocationNames.Add(calcloc.Name); LocationGuid.Add(calcloc.Guid); }