public IPositionSet_ConnectedEdit Produce()
        {
            if (style == mapStyle.RandomMaze_duplex)
            {
                PositionMap positionMap = new PositionMap(config.Width, config.Height);
                positionMap.GenerateRandomMaze();
                return(positionMap.GetPositionSet_ConnectedEdit());
            }
            else
            {
                List <IPosition_Connected_Edit> list = null;
                switch (style)
                {
                case mapStyle.RandomFloatPositions_InFixedDistribution:
                    list = RandomPositionList.generateRandomFloatPositions_InFixedDistribution(config);
                    break;

                case mapStyle.RandomFloatPositions:
                    list = RandomPositionList.generateRandomFloatPositions(config);
                    break;

                case mapStyle.RandomIntPositions_InFixedDistribution:
                    list = RandomPositionList.generateRandomIntPositions_InFixedDistribution(config);
                    break;

                case mapStyle.RandomIntegerPositions:
                    list = RandomPositionList.generateRandomIntPositions(config);
                    break;
                }
                IPositionSet_ConnectedEdit pSet = new PositionSet_ConnectedEdit(list);
                return(pSet);
            }
        }
Example #2
0
        public void GenerateRandomMap(int totalAmount, int amount1, int amount2, int amount3, double probability1, double probability2, double probability3)
        {
            List <IPosition_Connected_Edit> newList = RandomPositionList.generateRandomIntPositions(width, height, totalAmount, amount1, amount2, amount3, probability1, probability2, probability3);

            if (newList != null)
            {
                Clear();
                list = newList;
                PutAllPositionsInListIntoArray();
            }
        }