コード例 #1
0
        public void DumpRadar(string cmd, string[] cmdsplit, int player)
        {
            logfile.WriteLine("calling GetRadarMap...");
            bool[] LosMap = aicallback.GetRadarMap();
            logfile.WriteLine("...done");
            int loswidth  = aicallback.GetMapWidth() / 8;
            int losheight = aicallback.GetMapHeight() / 8;

            logfile.WriteLine("losmap width: " + loswidth + " losheight: " + losheight);
            ArrayIndexer arrayindexer = new ArrayIndexer(loswidth, losheight);

            for (int y = 0; y < losheight; y++)
            {
                string line = "";
                for (int x = 0; x < loswidth; x++)
                {
                    if (LosMap[arrayindexer.GetIndex(x, y)])
                    {
                        aicallback.DrawUnit("ARMRAD", new Float3(x * 64, 0, y * 64), 0.0f, 100, aicallback.GetMyAllyTeam(), true, true);
                        line += "*";
                    }
                    else
                    {
                        line += "-";
                    }
                }
                logfile.WriteLine(line);
            }
            aicallback.SendTextMsg("radar dumped to logfile", 0);
        }