Пример #1
0
        public void DrawUnit(HexTilePosition pos, UnitType type)
        {
            Vector3 mapPos = RenderHex.HexPositionToMapPosition(pos);
            render.PushWorldMatrix(Matrix.CreateTranslation(mapPos));

            switch (type)
            {
                case UnitType.Unknown:
                    DrawUnknown();
                    break;

                case UnitType.Infantry:
                    DrawInfantry();
                    break;

                case UnitType.Armor:
                    DrawArmor();
                    break;

                case UnitType.Artillery:
                    DrawArtillery();
                    break;

                default:
                    DrawInvalid();
                    break;
            }

            render.PopWorldMatrix();
        }
Пример #2
0
 public TerrainType this[HexTilePosition pos]
 {
     get
     {
         int i = pos.Y * Width + pos.X;
         if (i > terrain.Length) { return TerrainType.None; }
         return terrain[i];
     }
 }
Пример #3
0
 public Unit(UnitType type, HexTilePosition pos)
 {
     Type = type;
     Position = pos;
 }