public void Draw(IComponent component, SKCanvas canvas, float scale) { var allComponents = new List <IComponent>(); component.AppendTo(allComponents); foreach (var c in allComponents) { var dc = c as IDrawerComponent; if (dc == null) { continue; } dc.Draw(canvas, scale); } }
public void Handle(IComponent component, long touchId, SKPoint touchLocation, TouchAction touchAction) { var allComponents = new List <IComponent>(); component.AppendTo(allComponents); foreach (var c in allComponents) { var thc = c as ITouchHandlerComponent; if (thc == null) { continue; } var hr = thc.Handle(touchId, touchLocation, touchAction); if (hr) { break; } } }