Made progress on implementing some shops.
Performed some folder restructuring as well.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Props.Shop.Framework;
|
||||
|
||||
namespace Props.Shop.Adafruit.Options
|
||||
{
|
||||
public class SimilarityOption : IOption
|
||||
{
|
||||
private Configuration configuration;
|
||||
public string Name => "Query Similarity";
|
||||
|
||||
public string Description => "The minimum level of similarity for a listing to be returned.";
|
||||
|
||||
public bool Required => true;
|
||||
|
||||
public Type Type => typeof(float);
|
||||
|
||||
internal SimilarityOption(Configuration configuration)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public string GetValue()
|
||||
{
|
||||
return configuration.Similarity.ToString();
|
||||
}
|
||||
|
||||
public bool SetValue(string value)
|
||||
{
|
||||
float parsed;
|
||||
bool success = float.TryParse(value, out parsed);
|
||||
configuration.Similarity = parsed;
|
||||
return success;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user