public IEntity GetDigit(int num, Vector2 pos)
        {
            IEntity returnEntity = new Number0(pos);

            switch (num)
            {
            case 0:
                returnEntity = new Number0(pos);
                break;

            case 1:
                returnEntity = new Number1(pos);
                break;

            case 2:
                returnEntity = new Number2(pos);
                break;

            case 3:
                returnEntity = new Number3(pos);
                break;

            case 4:
                returnEntity = new Number4(pos);
                break;

            case 5:
                returnEntity = new Number5(pos);
                break;

            case 6:
                returnEntity = new Number6(pos);
                break;

            case 7:
                returnEntity = new Number7(pos);
                break;

            case 8:
                returnEntity = new Number8(pos);
                break;

            case 9:
                returnEntity = new Number9(pos);
                break;
            }

            return(returnEntity);
        }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Number1.GetHashCode();
         hashCode = (hashCode * 397) ^ Number2.GetHashCode();
         hashCode = (hashCode * 397) ^ Number3;
         hashCode = (hashCode * 397) ^ Number4.GetHashCode();
         hashCode = (hashCode * 397) ^ Number5.GetHashCode();
         hashCode = (hashCode * 397) ^ Number6.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Number7;
         hashCode = (hashCode * 397) ^ Number8.GetHashCode();
         hashCode = (hashCode * 397) ^ Number9.GetHashCode();
         return(hashCode);
     }
 }