示例#1
0
        public static void JailBreak(int distance, FlowMap ourFlow)
        {
            // note perhaps we could integrate this into the larger flow
            //  system after it's working well?
            // todo change to using FlowTileSet here

            // get list of capture tiles
            FlowTileSet jails = new FlowTileSet();

            foreach (Loc l in Refs.m.pents)
            {
                jails.Add(ourFlow.TileByLoc(l));
            }

            // get list of cubi locations
            FlowTileSet breaker = new FlowTileSet();

            foreach (Cubi c in Refs.h.roster)
            {
                breaker.Add(ourFlow.TileByLoc(c.loc));
            }

            // IntersectWith to get occupied jails
            jails.IntersectWith(breaker);

            // set jails as heads
            foreach (FlowTile fs in jails)
            {
                fs.flow = 0;
            }

            // just flow to them
            ourFlow.RunFlow(maskWalls: true);
        }
示例#2
0
        public static void FlowOutAndBack(int distance, FlowMap ourFlow)
        {
            // ref http://www.roguebasin.com/index.php?title=Dijkstra_Maps_Visualized
            ourFlow.SetToNines();
            ourFlow.TileByLoc(Refs.p.loc).flow = 0;

            ourFlow.RunFlow(maskWalls: true);
            ReportHighAndLow(ourFlow, "after first flow");

            ourFlow.Reverse();
            ReportHighAndLow(ourFlow, "after reverse   ");

            ourFlow.MultFactor(1.5);
            ReportHighAndLow(ourFlow, "after mult      ");

            ourFlow.RunFlow(maskWalls: true);
            ReportHighAndLow(ourFlow, "after 2nd flow  ");

            ourFlow.AdjustFactor(-25);
        }