private void drawCharacter(int x, int y, DGlobal.MapDistances distance, DGlobal.MapPositions position, DGlobal.MapOrientations lookOrientation) { DCharacter character = null; int positionX = x; int positionY = y; switch (position) { case DGlobal.MapPositions.RIGHT1: DGlobal.moveRight(lookOrientation, ref positionX, ref positionY, 1); break; case DGlobal.MapPositions.RIGHT2: DGlobal.moveRight(lookOrientation, ref positionX, ref positionY, 2); break; case DGlobal.MapPositions.LEFT1: DGlobal.moveLeft(lookOrientation, ref positionX, ref positionY, 1); break; case DGlobal.MapPositions.LEFT2: DGlobal.moveLeft(lookOrientation, ref positionX, ref positionY, 2); break; } DGlobal.moveForward(lookOrientation, ref positionX, ref positionY, (int)distance); foreach (DCharacter characterTMP in this.mCharacters) { if (characterTMP.getPositionX() == positionX && characterTMP.getPositionY() == positionY) { character = characterTMP; break; } } if (character != null) { character.draw(distance, position); } }
public void addCharacter(DCharacter character) { this.mCharacters.Add(character); }