Beispiel #1
0
    public void LoadSeadedMap()
    {
        Seed = File.ReadAllText(Application.dataPath + "/MapLog.txt");
        //This is gonna be easier now its gonna start from the first spot
        for (int x = 0; x < (AllMapTiles.Count * 3); x++)
        {
            MapTile  Temp     = AllMapTiles[x / 3];
            int      TT       = (int)char.GetNumericValue(Seed[x]);
            TileType TempType = (TileType)TT;
            x++; //This stuff is so we can keep track of where our thing is reading the seed

            int          TM      = (int)char.GetNumericValue(Seed[x]);
            MaterialTile TempMat = (MaterialTile)TM;
            x++;

            // ChangeTile(TempType, Temp.X, Temp.Y, Temp.Roughness);
            //Changing the Type directly
            if (AllMapTiles[x / 3] != null)
            {
                AllMapTiles[x / 3].Type        = TempType;
                AllMapTiles[x / 3].OcupedByMat = TempMat;
            }
            else
            {
                Debug.LogWarning("Tile not found");
            }


            //   Debug.Log("(" + Temp.X + ";" + Temp.Y + ")" + TempType + "," + TempMat);
        }


        //This can be expanded
    }
Beispiel #2
0
    void OcupyTileMat(MaterialTile M, int X, int Y)
    {
        MapTile Tile = FindTile(X, Y);

        if (Tile != null)
        {
            Tile.OcupedByMat = M;
        }
    }
Beispiel #3
0
 public MapTile(int newX, int newY, int newRoughness, TileType NewType) //Simple constructor to give it values quick
 {
     Neighbours        = new MapTile[4];
     FarNeighbours     = new MapTile[4];
     X                 = newX;
     Y                 = newY;
     Roughness         = newRoughness;
     Type              = NewType;
     OcupedByMat       = MaterialTile.None;
     OcupiedByUnit     = UnitIn.None;
     OcupingUnitScript = null;
     Visible           = false;
     Discovered        = false;
     //  Debug.Log("me llaman");
 }