本文介绍了用于设置具有图块集的2D地图的算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索一个算法来设计一个带有固定图块集的2D地图



我必须解决一个问题,比如Windows 8 UI

我的意思是我有一套不同大小的矩形瓷砖,没有分数。



我必须随机使用这些瓷砖组成一个矩形。



地图的大小可以是10x10为例。

瓷砖尺寸可以是1x1,2x2,4x2,3x3等等



但是瓷砖可能有一些限制:



- 有些瓷砖可以使用更多比一个,但他们有一个最大发生限制。

- 一些瓷砖是强制性的。

- 有些瓷砖有位置限制:

--some瓷砖只允许在边框附近(左,右,上,下)

- 有些瓷砖只能放在[(x1,y1)或(x2,y2)或......]



我认为这是一个众所周知的问题,在列表中没有约束



有人记得Ť他有关于它的设计模式的名称

或任何其他信息,以帮助我找到有关此算法的信息?



谢谢你

Riccardo

I am searching an Algorithm for design a 2D map with a fixed tile set

I must resolve a problem such as Windows 8 UI
I means I have a set of rectangle tiles of different size, NO FRACTIONAL.

I have to compose a rectangle, using these tiles randomly.

The size of the map could be 10x10 as example.
Tiles size could be 1x1, 2x2, 4x2, 3x3, and so on

But the tiles could have some constraint:

-Some tiles could be used more than one but them have a max occurrence limit.
-Some tiles are mandatory.
-Some tiles have position constraints:
--some tiles are allowed only near a border (left, right, top, bottom)
--some tiles could be positioned only at [(x1,y1) or (x2,y2) or ...]

I think that is a "well known problem", at list without the constraint

Someone remember the name of a design pattern about it
or any other info to help me to find information about this algorithm?

Thank you
Riccardo

推荐答案


这篇关于用于设置具有图块集的2D地图的算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 12:36