public void BoxRotate() { if (OpenDir != OpenSideDir.osdLeft) { OpenDir++; } else { OpenDir = OpenSideDir.osdUp; } BoxClear(); BoxDraw(); }
public BoxTrap(int pos_x, int pos_y, int size) //конструктор { OpenDir = OpenSideDir.osdUp; pos = new Vector(pos_x, pos_y); this.sym = '&'; if (size > 2 && size < 5) { this.size = size - 1; } else { this.size = 3; } BoxDraw(); }
//отрисовка зайца в коробке, если он там есть private void BoxTrappedObjDraw(OpenSideDir OpenSide) { int i = 0; foreach (RabbitSymbol c in trapped_obj) { if (c.GetSym != ' ') { switch (OpenDir) { case OpenSideDir.osdLeft: { if (i == 0) { TrappedSymDraw(pos.X + size - 1, pos.Y + 1, c); } else if (i == 1) { TrappedSymDraw(pos.X + size - 1, pos.Y + 2, c); } } break; case OpenSideDir.osdRight: { if (i == 0) { TrappedSymDraw(pos.X + 1, pos.Y + size - 1, c); } else if (i == 1) { TrappedSymDraw(pos.X + 1, pos.Y + size - 2, c); } } break; case OpenSideDir.osdUp: { if (i == 0) { TrappedSymDraw(pos.X + size - 1, pos.Y + size - 1, c); } else if (i == 1) { TrappedSymDraw(pos.X + size - 2, pos.Y + size - 1, c); } } break; case OpenSideDir.osdDown: { if (i == 0) { TrappedSymDraw(pos.X + 1, pos.Y + 1, c); } else if (i == 1) { TrappedSymDraw(pos.X + 2, pos.Y + 1, c); } } break; } } i++; } }