protected virtual Hindernis AddTegel(int x, int y) { Hindernis result = null; switch (_random.Next(4)) { case 0: result = new Tegel_0_0(x, y); break; case 1: result = new Tegel_0_1(x, y); break; case 2: result = new Tegel_0_2(x, y); break; case 3: result = new Tegel_0_3(x, y); break; } Hindernissen.Add(result); return(result); }
protected virtual Hindernis AddTegel(int x, int y) { Hindernis result = null; switch (_random.Next(4)) { case 0: result = new Tegel_0_0(x + (int)_offsetPosition.X, y + (int)_offsetPosition.Y); break; case 1: result = new Tegel_0_1(x + (int)_offsetPosition.X, y + (int)_offsetPosition.Y); break; case 2: result = new Tegel_0_2(x + (int)_offsetPosition.X, y + (int)_offsetPosition.Y); break; case 3: result = new Tegel_0_3(x + (int)_offsetPosition.X, y + (int)_offsetPosition.Y); break; } _hindernissen.Add(result); return(result); }