/// <summary> /// Attempts to get to a store from the currently selected object(s) in the property grid. /// </summary> protected Store GetStore(object gridSelection) { // We assume that "instance" will either be a single model element, or // an array of model elements (if multiple items are selected). IHasStore currentElement = gridSelection is object[] objects && objects.Length > 0 ? objects[0] as IHasStore : gridSelection as IHasStore; return(currentElement?.Store); }
public Result Transfer(IHasStore target, Resource resource, int amount = 0) { return((Result)_js.InvokeById <int>(id, "_transfer", ((IStructure)target).id, resource.ToString(), amount)); }