public void DumpBuildMap(string cmd, string[] cmdsplit, int player)
 {
     for (int y = 0; y < aicallback.GetMapHeight(); y++)
     {
         string line = "";
         for (int x = 0; x < aicallback.GetMapWidth(); x++)
         {
             if (BuildMap.GetInstance().SquareAvailable[x, y])
             {
                 line += "-";
             }
             else
             {
                 aicallback.DrawUnit("ARMMINE1", new Float3(x * 8, 0, y * 8), 0.0f, 400, aicallback.GetMyAllyTeam(), true, true);
                 line += "*";
             }
         }
         logfile.WriteLine(line);
     }
 }
Exemple #2
0
    private void OnMouseDown()
    {
        if (isMarked || BuildMap.isGameOver || GameMenu.isPaused)
        {
            return;
        }

        if (!BuildMap.isOpen[i, j])
        {
            BuildMap.isOpen[i, j] = true;

            BuildMap map = FindObjectOfType <BuildMap>();
            if (!BuildMap.isFirstStepDone)
            {
                BuildMap.isFirstStepDone = true;
                if (map)
                {
                    map.FirstStep();
                }
            }
            map.OpenNewCell(i, j);

            ColorText(i, j);

            if (BuildMap.field[i, j] != "*")
            {
                gameObject.GetComponent <MeshRenderer>().material.color = openColor;
            }

            if (BuildMap.flagsCount + BuildMap.openedCell == BuildMap.needCell)
            {
                GameMenu gameMenu = FindObjectOfType <GameMenu>();
                gameMenu.Win();
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     socket     = GetComponent <SocketIOComponent>();
     mapBuilder = map.GetComponent <BuildMap>();
     socket.On("open", OnConnected);
 }