Beispiel #1
0
        protected override DrawerBase CreateVillageDecoratorDrawerCore(DecoratorDrawerData data, BackgroundDrawerData mainData)
        {
            if (data.Shape == null)
            {
                return null;
            }

            switch (data.Shape.Drawer)
            {
                case "BorderDrawer":
                    var drawer = mainData.ShapeDrawer == "EllipseDrawer" ? BorderDrawer.EllipseDrawer : BorderDrawer.RectangleDrawer;
                    return new BorderDrawer(data.Shape.Color, drawer);

                default:
                    throw new Exception("Not implemented: " + data.Shape.Drawer);
            }
        }
Beispiel #2
0
 protected abstract DrawerBase CreateVillageDecoratorDrawerCore(DecoratorDrawerData data, BackgroundDrawerData mainData);
 protected override DrawerBase CreateVillageDecoratorDrawerCore(DecoratorDrawerData data, BackgroundDrawerData mainData)
 {
     return null;
 }
Beispiel #4
0
 /// <summary>
 /// Create drawer to further decorate a village drawn by <see cref="CreateVillageDrawer"/>
 /// </summary>
 /// <param name="data">The shape of the drawer</param>
 /// <param name="colors">The colors for the drawer</param>
 /// <param name="mainData">The data for the main drawer (used for BorderDrawer)</param>
 public DrawerBase CreateVillageDecoratorDrawer(DecoratorDrawerData data, BackgroundDrawerData mainData)
 {
     Debug.Assert(SupportDecorators);
     DrawerBase drawer = CreateVillageDecoratorDrawerCore(data, mainData);
     return drawer;
 }
Beispiel #5
0
 /// <summary>
 /// A VillageType decorator (off, def, ... icons)
 /// </summary>
 protected override DrawerBase CreateVillageDecoratorDrawerCore(DecoratorDrawerData data, BackgroundDrawerData mainData)
 {
     return new IconDrawerDecorator(data.Icon);
 }