public void Set(string name, string valueStr) { bool successfulConversion = NumberConversions.TryStr2Int(valueStr, out var value); if (name.Equals("finddistance", StringComparison.OrdinalIgnoreCase)) { bridge.SetFindDistance(successfulConversion ? value : 0); } }
public int GetObject(string id) { if (Objects.TryGet(id, out var value)) { return(value); } if (NumberConversions.TryStr2Int(id, out value)) { return(value); } return(0); }
public int GetObject(string id) { if (id.Equals("finditem", StringComparison.OrdinalIgnoreCase)) { return(bridge.FindItem); } if (id.Equals("self", StringComparison.OrdinalIgnoreCase)) { return(bridge.Self); } if (id.Equals("lastcorpse", StringComparison.OrdinalIgnoreCase)) { return(bridge.LastCorpse); } if (id.Equals("lasttarget", StringComparison.OrdinalIgnoreCase)) { return(bridge.LastTarget); } if (id.Equals("laststatus", StringComparison.OrdinalIgnoreCase)) { return(bridge.LastStatus); } if (id.Equals("backpack", StringComparison.OrdinalIgnoreCase)) { return(bridge.Backpack); } if (objects.TryGet(id, out var value)) { return(value); } if (NumberConversions.TryStr2Int(id, out value)) { return(value); } return(0); }