Ejemplo n.º 1
0
    protected static void GenerateMap()
    {
        if (Player.HasRelic("MemberShipCard"))
        {
        }

        int tMapHeight  = 15;
        int tMapWidth   = 7;
        int tMapDensity = 6;
        List <AbstractRoom> tRoomList = new List <AbstractRoom>();

        Map = MapGenerator.GenerateDungeon(tMapHeight, tMapWidth, tMapDensity, MapRng);
        int tCount = 0;

        for (int i = 0; i < Map.Count; i++)
        {
            for (int j = 0; j < Map[i].Count; j++)
            {
                MapRoomNode tNode = Map[i][j];
                //if (tNode.IsHasEdges()&&tNode.y)
                //{

                //}
            }
        }
        //generateroo
    }
Ejemplo n.º 2
0
    public bool PassesDountCheck(List <List <MapRoomNode> > _map)
    {
        int tWidth     = _map[0].Count;
        int tHeight    = _map.Count;
        int tNodeCount = 0;

        bool[] tRoomHasNode = new bool[tWidth];
        for (int i = 0; i < tWidth; i++)
        {
            tRoomHasNode[i] = false;
        }

        List <MapRoomNode> tSecondToLastRow = _map[_map.Count - 2];

        for (int i = 0; i < tSecondToLastRow.Count; i++)
        {
            MapRoomNode tMapRoomNode = tSecondToLastRow[i];
            for (int j = 0; j < tMapRoomNode.GetEdges().Count; j++)
            {
                tRoomHasNode[tMapRoomNode.GetEdges()[j].dstX] = true;
            }
        }

        int tRoomCount;

        for (tRoomCount = 0; tRoomCount < tWidth - 1; tRoomCount++)
        {
            if (tRoomHasNode[tRoomCount])
            {
                tNodeCount++;
            }
        }

        if (tNodeCount != 1)
        {
            return(false);
        }
        else
        {
            tRoomCount = 0;
            for (int i = 0; i < _map.Count; i++)
            {
                List <MapRoomNode> tRow = _map[i];
                for (int j = 0; j < tRow.Count; j++)
                {
                    if (null != tRow[j].Room)
                    {
                        tRoomCount++;
                    }
                }
            }

            return(true);
        }
    }
Ejemplo n.º 3
0
    public bool IsConnectedTo(MapRoomNode _node)
    {
        MapEdge tMapEdge;

        if (edges.Count == 0)
        {
            return(false);
        }
        for (int i = 0; i < edges.Count; i++)
        {
            //if (edges[i].)
            //{

            //}
        }

        return(true);
    }
Ejemplo n.º 4
0
 public static void SetCurMapNode(MapRoomNode _curMapNode)
 {
 }
Ejemplo n.º 5
0
 public void AddParent(MapRoomNode _parent)
 {
     parents.Add(_parent);
 }