Example #1
0
    public override bool Equals(object obj)
    {
        if (obj == null || GetType() != obj.GetType())
        {
            return(false);
        }

        VectorCube other = (VectorCube)obj;

        return((x == other.x) && (y == other.y) && (z == other.z));
    }
Example #2
0
    public VectorHex(VectorCube vc)
    {
        VectorHex vx = vc.ToAxial();

        Set(vx.q, vx.r);
    }
Example #3
0
 // given vc coordinates, respective coordinates in 2d plane will be calculated for the pointy orientation
 private Vector2 CubeToCart(VectorCube vc)
 {
     return(new Vector2(WIDTH_RATIO * tileSize * (vc.x - vc.y) / 2.0f, HEIGHT_RATIO * tileSize * -vc.z * 3f / 4f));
 }
Example #4
0
    public VectorCube(VectorHex vx)
    {
        VectorCube vc = vx.ToCube();

        Set(vc.x, vc.y, vc.z);
    }