public IGrammar UsingObjectIs() { return CreateObject<Location>("The location is", _ => { _.ObjectIs = c => new Location {X = Context.State.Retrieve<int>()}; _.SetProperty(x => x.Y); _.Do(location => _location = location); }); }
public void LoadLocation() { _location = new Location(); Context.State.CurrentObject = _location; }
public IGrammar AllProps() { return CreateNewObject<Location>("The location is", _ => { _.SetAllPrimitivePropertiesSpecificToThisType(); _.Do(x => _location = x); }); }
public IGrammar UsingWithInput() { return CreateNewObject<Location>("The location is", _ => { _.WithInput<string>("data is {data}").Configure((location, data) => { var parts = data.Split(';'); location.X = int.Parse(parts.First()); location.Y = int.Parse(parts.Last()); }).DefaultValue("1;2"); _.Do(x => _location = x); }); }