public void CustomPasswordValidator(int minimumLength, int maximumLength, MyCustomObjectType myCustomObject) { // guard clause if (myCustomObject == null) { throw new ArgumentExpcetion("myCustomObject was not provided."); } _myCustomObject = myCustomObject; this.MinimumLength = minimumLength; this.MaximumLength = maximumLength; }
void GenerateData(int size) { m_Data = new List <MyCustomObjectType>(size); for (var i = 0; i < size; ++i) { var posX = Random.Range(0, 100); var posY = Random.Range(0, 100); var newObj = new MyCustomObjectType { Id = i, Position = new Vector2(posX, posY) }; m_Data.Add(newObj); } }
static bool IsFilterResolver(MyCustomObjectType data, string op, string keyword) { if (op != ":") { return(false); } if (keyword.Equals("high-priority")) { return(data.Id > 900 && data.Position.magnitude > 85.0f); } return(false); }