Example #1
0
 /// <summary>
 /// コンストラクタ(コピー)
 /// </summary>
 /// <param name="copy_src"></param>
 public Wall(Wall copy_src)
 {
     map_x        = copy_src.map_x;
     map_y        = copy_src.map_y;
     material     = copy_src.material;
     panel        = copy_src.panel;
     height       = copy_src.height;
     direction_id = copy_src.direction_id;
 }
Example #2
0
        public Wall(int map_x, int map_y, int height, DirectionID direction_id)
        {
            this.map_x        = map_x;
            this.map_y        = map_y;
            this.height       = height;
            this.direction_id = direction_id;

            var size = new SDPoint(BattleMap.SQUARE_SIZE, BattleMap.HIGHT_ONE_VALUE);

            panel = null;
            switch (direction_id)
            {
            case DirectionID.S:
            {
                var pos = new S3DPoint(BattleMap.SQUARE_SIZE * (map_x + 0.5), BattleMap.HIGHT_ONE_VALUE * (height + 0.5), BattleMap.SQUARE_SIZE * (map_y + 0.0));
                panel = new S3DPanel(pos, size, S3DPanel.Direction.Wall_NS);
            }
            break;

            case DirectionID.E:
            {
                var pos = new S3DPoint(BattleMap.SQUARE_SIZE * (map_x + 1.0), BattleMap.HIGHT_ONE_VALUE * (height + 0.5), BattleMap.SQUARE_SIZE * (map_y + 0.5));
                panel = new S3DPanel(pos, size, S3DPanel.Direction.Wall_EW);
            }
            break;

            case DirectionID.N:
            {
                var pos = new S3DPoint(BattleMap.SQUARE_SIZE * (map_x + 0.5), BattleMap.HIGHT_ONE_VALUE * (height + 0.5), BattleMap.SQUARE_SIZE * (map_y + 1.0));
                panel = new S3DPanel(pos, size, S3DPanel.Direction.Wall_NS);
            }
            break;

            case DirectionID.W:
            {
                var pos = new S3DPoint(BattleMap.SQUARE_SIZE * (map_x + 0.0), BattleMap.HIGHT_ONE_VALUE * (height + 0.5), BattleMap.SQUARE_SIZE * (map_y + 0.5));
                panel = new S3DPanel(pos, size, S3DPanel.Direction.Wall_EW);
            }
            break;
            }
        }
        private static int enumDirectionToIndex(Direction direction)
        {
            DirectionID id = DirectionID.None;

            switch (direction)
            {
            case Direction.None:
                id = DirectionID.None;
                break;

            case Direction.Horizontal:
                id = DirectionID.Horizontal;
                break;

            case Direction.Vertical:
                id = DirectionID.Vertical;
                break;

            case Direction.LeftToRight:
                id = DirectionID.LeftToRight;
                break;

            case Direction.BottomToTop:
                id = DirectionID.BottomToTop;
                break;

            case Direction.TopToBottom:
                id = DirectionID.TopToBottom;
                break;

            case Direction.RightToLeft:
                id = DirectionID.RightToLeft;
                break;

            default:
                return(0);
            }
            return((int)id);
        }