Esempio n. 1
0
 public Tybing4(int y, int x, int rotation = 0, SubjectStateType subjectstate = SubjectStateType.Normal)
 {
     Point.X           = x;
     Point.Y           = y;
     this.SubjectState = subjectstate;
     this.rotation     = rotation;
 }
Esempio n. 2
0
        static ITybing createTybing(int y, int x, SubjectType subjectType, SubjectStateType subjectState, bool islevelhorizontally)
        {
            var rotation = 0;

            if (subjectState == SubjectStateType.Entry)
            {
                StartTybing.X = x;
                StartTybing.Y = y;
            }

            if (subjectState == SubjectStateType.Exit)
            {
                FinishTybing.X = x;
                FinishTybing.Y = y;
            }

            if (islevelhorizontally && ((subjectState == SubjectStateType.Entry) || (subjectState == SubjectStateType.Exit)))
            {
                rotation = 90;
            }

            switch (subjectType)
            {
            case SubjectType.Tybing1:
                return(new Tybing1(y, x, rotation: rotation, subjectstate: subjectState));

            case SubjectType.Tybing2:
                return(new Tybing2(y, x, rotation: rotation, subjectstate: subjectState));

            case SubjectType.Tybing3:
                return(new Tybing3(y, x, rotation: rotation, subjectstate: subjectState));

            case SubjectType.Tybing4:
                return(new Tybing4(y, x, rotation: rotation, subjectstate: subjectState));

            case SubjectType.Brick:
                return(new Brick(y, x));

            default:
                return(null);
            }
        }