Exemplo n.º 1
0
 public HexVisual(Point2D point, Hex hex)
     : base(point)
 {
     _Hex = hex;
     Init();
     InitHex();
 }
Exemplo n.º 2
0
 public TerritoryVisual(Point2D point, Territory territory)
     : base(point)
 {
     _Territory = territory;
     Init();
 }
Exemplo n.º 3
0
        private Point2D AddOffset(Point2D point, EPointPositionOnHex positionOnHex)
        {
            switch (positionOnHex)
            {
                case (EPointPositionOnHex.TopMiddle):
                    return new Point2D(
                        point.X + Hex.HalfWidth,
                        point.Y);
                case (EPointPositionOnHex.RightTop):
                    return new Point2D(
                        point.X + Hex.Width,
                        point.Y + Hex.BottomHeight);
                case (EPointPositionOnHex.RightBottom):
                    return new Point2D(
                        point.X + Hex.Width,
                        point.Y + Hex.PartialHeight);
                case (EPointPositionOnHex.BottomMiddle):
                    return new Point2D(
                        point.X + Hex.HalfWidth,
                        point.Y + Hex.PartialHeight);

            }
            throw new ArgumentException("Enum cannot be " + positionOnHex.ToString());
        }
Exemplo n.º 4
0
        public Point2D AddOffset(EPointPositionOnHex position, BoardVisual b, Point2D point)
        {
            Point2D result = new Point2D();
            // Offsets for positioning the visuals correctly
            double offsetx = 0;// (b.Board.Width * Hex.Width) / 2;
            double offsety = 0;// ((b.Board.Height * Hex.PartialHeight) + Hex.BottomHeight) / 2;

            switch (position)
            {
                case EPointPositionOnHex.TopMiddle:
                    result.X = point.X + offsetx + Hex.HalfWidth;
                    result.Y = point.Y + offsety;
                    return result;
                case EPointPositionOnHex.RightTop:
                    result.X = point.X + offsetx + Hex.Width;
                    result.Y = point.Y + offsety + Hex.BottomHeight;
                    return result;
                case EPointPositionOnHex.RightBottom:
                    result.X = point.X + offsetx + Hex.Width;
                    result.Y = point.Y + offsety + Hex.PartialHeight;
                    return result;
                case EPointPositionOnHex.BottomMiddle:
                    result.X = point.X + offsetx + Hex.HalfWidth;
                    result.Y = point.Y + offsety + Hex.Height;
                    return result;
            }
            throw new Exception("Should not reach this");
        }
Exemplo n.º 5
0
 public Pirate(Point2D point, HexLocation location)
     : base(point)
 {
     _Location = location;
     Init();
 }
Exemplo n.º 6
0
 private Point2D AddRobberOffset(Point2D point)
 {
     point.X += Hex.HalfWidth;
     point.Y += (Hex.Height / 2);
     return point;
 }
Exemplo n.º 7
0
 public PlayerPiece(Point2D point,  Color color)
     : base(point)
 {
     _Color = color;
 }
Exemplo n.º 8
0
 public Piece(Point2D point)
 {
     _Point = point;
 }
Exemplo n.º 9
0
 public HexSideVisual(Point2D point, HexSide location)
     : base(point)
 {
     _Location = location;
     Init();
 }
Exemplo n.º 10
0
 public BuildPointVisual(Point2D point, HexPoint location)
     : base(point)
 {
     _Location = location;
     Init();
 }
Exemplo n.º 11
0
 public ControlPiece(Point2D point)
     : base(point)
 {
 }
Exemplo n.º 12
0
 public BonusVP(Point2D point)
     : base(point)
 {
     Init();
 }
Exemplo n.º 13
0
 public Card(Point2D point)
     : base(point)
 {
 }
Exemplo n.º 14
0
 public ChitVisual(Point2D point, EChitNumber n)
     : base(point)
 {
     this._Number = n;
     Init();
 }
Exemplo n.º 15
0
 public Robber(Point2D point, HexLocation location)
     : base(point)
 {
     _Location = location;
     Init();
 }
Exemplo n.º 16
0
 public Road(Point2D point, Color color, HexSide location)
     : base(point, color)
 {
     _Location = location;
     Init();
 }
Exemplo n.º 17
0
 public Traveller(Point2D point)
     : base(point)
 {
 }
Exemplo n.º 18
0
 public City(Point2D point, Color color, HexPoint location)
     : base(point, color)
 {
     Location = location;
     Init();
 }
Exemplo n.º 19
0
 public PortVisual(Point2D point, Port pt)
     : base(point)
 {
     this._XmlPort = pt;
     Init();
 }