public static void AddUnitBrush(this List <ImageBrushPair> list, EditorToolBar toolBar, Image image, EntityId id, Tile tile) { var brush = new UnitBrush( metadata: new UnitMetadata( entityId: id, tile: tile, owner: null )); toolBar.PlayerSelected += (s, e) => brush.ChangePlayer(e.Colour); list.Add(new ImageBrushPair(brush, image)); }
private static BrushBehaviourBase GetBrushBehaviorOfUnitBrush(UnitBrush ub) { return((BrushBehaviourBase)typeof(UnitBrush).GetMethod("GetBrushBehaviour").Invoke(ub, null)); }