void RotBack(int situation) { switch (situation) { case 0: break; case 1: teris1.RotBack(); teris2.RotBack(); break; case 2: teris2.RotBack(); teris2.CheckRotClash(teris1, true); break; case 3: teris1.RotBack(); teris1.CheckRotClash(teris2, true); break; } }
public bool CheckRotClash(TerisBlock another, bool isBlock) { foreach (Vector3 pos in currentPoints) { if (another.currentPoints.Contains(pos)) { if (isBlock) { another.RotBack(); return(false); } else { RotBack(); another.RotBack(); return(false); } } } return(true); }