Ejemplo n.º 1
0
 public void SetRoomGrid(ShapeValue S, int Buildid)
 {
     this.upMap         = S.UpMap;
     this.downMap       = S.DownMap;
     this.buildingid    = Buildid;
     this.m_CanPosition = GetCanPosition();
     this.m_Position    = (this.m_Position | S.Position);
 }
Ejemplo n.º 2
0
    public ShapeValue GetShape()
    {
        while (lastValues.Contains(resultShape = RandomShape()))
        {
            ;
        }

        lastValues.Add(resultShape);

        while (lastValues.Count > values.Count * 0.5)
        {
            lastValues.RemoveAt(0);
        }

        return(resultShape);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 获取形状数据
    /// </summary>
    public Dictionary <Int2, ShapeValue> GetShapeData()
    {
        Dictionary <Int2, ShapeValue> l = new Dictionary <Int2, ShapeValue>();

        if (width > 0 && height > 0)
        {
            for (int layer = 0; layer < height; layer++)
            {
                for (int unit = 0; unit < width; unit++)
                {
                    int shape = GetShapeValue(layer, unit);
                    if (shape == 1)
                    {
                        ShapeValue value = new ShapeValue();
                        value.UpMap   = GetUpMapValue(layer, unit);
                        value.DownMap = GetDownMapValue(layer, unit);
                        l.Add(new Int2(unit, layer), value);
                    }
                }
            }
        }
        return(l);
    }