Esempio n. 1
0
        protected Coords(CoordsType coordsType, IntVector2D vector)
        {
            switch (coordsType)
            {
            default:
            case CoordsType.Canon:   _vectorCanon = vector;  isUserNull = isCustomNull = true;  break;

            case CoordsType.User:    _vectorUser = vector;  isCustomNull = isCanonNull = true;  break;

            case CoordsType.Custom:  _vectorCustom = vector;  isCanonNull = isUserNull = true;  break;
            }
        }
 ICoordsCanon ICoordsCanon.StepOut(IntVector2D vector)
 {
     return(StepOut(vector));
 }
 /// <summary> Initializes a new <code>IntMatrix2D</code> as the translation defined by the vector v.</summary>
 /// <param name="v">the translation vector</param>
 public IntMatrix2D(IntVector2D v)  : this(1, 0, 0, 1, v.X, v.Y, 1)
 {
 }
 /// <summary>Vector Rotation (only).</summary>
 /// <param name="v">IntVector2D to be rotated.</param>
 /// <returns>New IntVector2D resulting from rotaion (only) of vector v by this matrix
 /// (ignoring any translation components of this matrix).</returns>
 public IntVector2D Rotate(IntVector2D v)
 {
     return(new IntVector2D(v.X * M11 + v.Y * M12, v.X * M21 + v.Y * M22, v.W * M33).Normalize());
 }
 HexCoords(CoordsType coordsType, IntVector2D vector) : base(coordsType, vector)
 {
 }
 public static ICoordsCustom NewCustomCoords(IntVector2D vector)
 {
     return(new HexCoords(CoordsType.Custom, vector));
 }
 public static ICoordsUser   NewUserCoords(IntVector2D vector)
 {
     return(new HexCoords(CoordsType.User, vector));
 }
 public static ICoordsCanon  NewCanonCoords(IntVector2D vector)
 {
     return(new HexCoords(CoordsType.Canon, vector));
 }
 protected override ICoordsCanon StepOut(IntVector2D vector)
 {
     return(NewCanonCoords(VectorCanon + vector));
 }
Esempio n. 10
0
 protected abstract ICoordsCanon StepOut(IntVector2D vector);