Exemplo n.º 1
0
 public LaysTerrain(Actor self, LaysTerrainInfo info)
 {
     this.info = info;
     layer     = self.World.WorldActor.Trait <BuildableTerrainLayer>();
     bi        = self.World.WorldActor.Trait <BuildingInfluence>();
     template  = self.World.TileSet.Templates[info.Template];
 }
 protected override Windows.UI.Xaml.Style SelectStyleCore(object item, Windows.UI.Xaml.DependencyObject container)
 {
     if (item is TileTemplate)
     {
         TileTemplate tile = item as TileTemplate;
         if (tile.IsAvailable)
         {
             return(DefaultStyle);
         }
         else
         {
             return(UnavailableStyle);
         }
     }
     else if (item is TileGlyph)
     {
         TileGlyph glyph = item as TileGlyph;
         if (glyph.IsAvailable)
         {
             return(DefaultStyle);
         }
         else
         {
             return(UnavailableStyle);
         }
     }
     else
     {
         return(DefaultStyle);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new copy of an EnvironmentTile from a particular template.
        /// </summary>
        /// <param name="templateName">The name of the template.</param>
        /// <param name="newPosition">The position of the tile.</param>
        /// <returns>A new EnvironmentTile.</returns>
        public EnvironmentTile GetNewTile(string templateName,
                                          Point newPosition)
        {
            TileTemplate    template = _tileTemplates[templateName];
            EnvironmentTile returnMe = new EnvironmentTile(template.Texture, template.CanAccess, _owner);

            returnMe.Id            = new Guid();
            returnMe.Position      = newPosition;
            returnMe.AdjacentTiles = new List <EnvironmentTile>(4);
            returnMe.ItemsOnGround = new List <Item>();
            if (returnMe.CanAccess)
            {
                returnMe.AreaID = 0;
            }
            else
            {
                returnMe.AreaID = -1;
            }
            for (int i = 0; i < 4; i++)
            {
                returnMe.AdjacentTiles.Add(null);
            }
            returnMe.ActorsOnTile = new List <Actor>();
            return(returnMe);
        }
Exemplo n.º 4
0
    public void AddTile()
    {
        TileTemplate tile = new TileTemplate(idTextBox.text, option_to_sprite[spriteDropdown.value].name);

        tiles.Add(tile);

        GameObject TilePreviewTemp = Resources.Load <GameObject>("Buttons/Tile-Preview");
        GameObject TilePreview     = Instantiate(TilePreviewTemp, sv_Content.transform);

        //Add sprite
        Image display = TilePreview.GetComponentInChildren <Image>();

        display.sprite = option_to_sprite[spriteDropdown.value];

        //Add text
        Text display_name = TilePreview.GetComponentInChildren <Text>();

        display_name.text = idTextBox.text;

        //Increase size of Tile Preview
        var content_transform = sv_Content.GetComponent <RectTransform>();

        content_transform.sizeDelta += new Vector2(0, 64 + 8);

        //Set position inside the preview so it fits
        var preview_transform = TilePreview.GetComponent <RectTransform>();

        preview_transform.localPosition = new Vector3(8, -((tiles.Count - 1) * 64) - ((tiles.Count - 1) * 8) - 8, 0);
    }
Exemplo n.º 5
0
        public ChunkTemplate(Chunk chunk, ChunkConnector[][] connectors, params DungeonClass[] mapTypes)
        {
            myConnectors = connectors;

            myWidth  = chunk.Width;
            myHeight = chunk.Height;

            myMapTypes = mapTypes;
            myEntities = chunk.Entities;

            myTiles = new TileTemplate[Width, Height];

            for (int x = 0; x < Width; ++x)
            {
                for (int y = 0; y < Height; ++y)
                {
                    GameTile tile = chunk.GetTile(x - chunk.X, y - chunk.Y);

                    myTiles[x, y] = new TileTemplate
                    {
                        IsWall = tile.IsWall,
                        Skin   = tile.Skin,
                        Alt    = tile.Alt
                    };
                }
            }

            FindOrganisedConnectors();
        }
Exemplo n.º 6
0
    public Tile CreateTileObject(TileTemplate template)
    {
        var tileObject = Instantiate(tileObjectPrefab, gameObject.transform);

        tileObject.SetValues(template);
        return(tileObject);
    }
Exemplo n.º 7
0
        private void FillTTempsList(TileTemplate TTemplate)
        {
            dgTTempEnemies.DataSource = null;

            var bindingList = new BindingList <NPC>(TTemplate.Enemies);
            var source      = new BindingSource(bindingList, null);

            dgTTempEnemies.DataSource = source;
        }
Exemplo n.º 8
0
        protected void LoadFromStream(BinaryReader stream)
        {
            myWidth  = stream.ReadInt16();
            myHeight = stream.ReadInt16();

            myTiles = new TileTemplate[Width, Height];

            for (int x = 0; x < Width; ++x)
            {
                for (int y = 0; y < Height; ++y)
                {
                    myTiles[x, y] = new TileTemplate();
                    myTiles[x, y].Load(stream);
                }
            }

            int types = stream.ReadInt16();

            myMapTypes = new DungeonClass[types];

            for (int i = 0; i < types; ++i)
            {
                myMapTypes[i] = DungeonClass.Get(stream.ReadString());
            }

            int entCount = stream.ReadInt16();

            myEntities = new Entity[entCount];

            for (int i = 0; i < entCount; ++i)
            {
                myEntities[i]             = Entity.Load(stream, false);
                myEntities[i].Probability = stream.ReadDouble();
            }

            myConnectors = new ChunkConnector[4][];

            for (int i = 0; i < 4; ++i)
            {
                int connectors = stream.ReadByte();

                myConnectors[i] = new ChunkConnector[connectors];

                for (int j = 0; j < connectors; ++j)
                {
                    myConnectors[i][j] = new ChunkConnector(stream, this);
                }
            }

            FindOrganisedConnectors();
        }
Exemplo n.º 9
0
    /*public TileStats(Tilemap tilemap, Vector3Int pos, TileBase sprite, int x, int y)
     * {
     *  TilemapMember = tilemap;
     *  TilemapMember.SetTile(pos, sprite);
     *  Location = pos;
     *  m_x = x;
     *  m_y = y;
     *
     *  unit = null;
     *  selectable = false;
     * }*/

    public TileStats(Tilemap tilemap, Vector3Int pos, TileTemplate template, int x, int y)
    {
        TilemapMember = tilemap;
        Tile tile = Tile.CreateInstance <Tile>();

        tile.sprite = template.GetSprite();
        tile_render = tile;
        TilemapMember.SetTile(pos, tile);
        Location = pos;
        m_x      = x;
        m_y      = y;

        unit       = null;
        selectable = false;
    }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        List <List <TileTemplate> > templates = new List <List <TileTemplate> >();

        for (int i = 0; i < 1; i++)
        {
            List <TileTemplate> col = new List <TileTemplate>();
            for (int j = 0; j < AvatarModel.HandSize; j++)
            {
                TileTemplate tt = new TileTemplate();
                col.Add(tt);
            }
            templates.Add(col);
        }

        if (PanelHand.GetComponent <ScrollableList>() != null)
        {
            PanelHand.GetComponent <ScrollableList>().Build(templates);
        }
    }
    public static List <List <TileTemplate> > LoadMapFromJson(string jsonString)
    {
        var N      = JSONNode.Parse(jsonString);
        int height = N["layers"][0]["height"].AsInt;
        int width  = N["layers"][0]["width"].AsInt;

        List <List <TileTemplate> > tiles = new List <List <TileTemplate> >();

        for (int y = 0; y < height; y++)
        {
            List <TileTemplate> thisRow = new List <TileTemplate>();
            for (int x = 0; x < width; x++)
            {
                int          id = N["layers"][0]["data"][y * width + x].AsInt;
                TileTemplate tt = TileTemplate.FromJsonInt(id);
                thisRow.Add(tt);
            }
            tiles.Add(thisRow);
        }
        return(tiles);
    }
Exemplo n.º 12
0
        public void AddEnemyToTTemp(TileTemplate tTemp, NPC enemyToAdd)
        {
            bool enemyExists = false;

            foreach (NPC tS in tTemp.Enemies)
            {
                if (tS.Name == enemyToAdd.Name)
                {
                    enemyExists = true;
                    break;
                }
            }
            if (enemyExists == false)
            {
                tTemp.Enemies.Add(enemyToAdd);
                FillTTempsList(tTemp);
            }
            else
            {
                MessageBox.Show("Enemy already exists in the current template.", "Enemy Exists.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 13
0
 public static extern string GetTemplate(TileTemplate templ);
Exemplo n.º 14
0
    internal void Prepare()
    {
        AvatarModel am = new AvatarModel(Card.Druid, false, null);

        Me = this;
        PanelInformation.SetActive(true);

        List <List <TileTemplate> > templates = new List <List <TileTemplate> >();

        for (int i = 0; i < 3; i++)
        {
            List <TileTemplate> col = new List <TileTemplate>();
            for (int j = 0; j < 4; j++)
            {
                TileTemplate tt = new TileTemplate();
                col.Add(tt);
            }
            templates.Add(col);
        }

        PanelBoardBack.GetComponent <ScrollableList>().Build(templates);

        templates[2][2].AddTemplate(Card.Druid);
        templates[0][1].AddTemplate(Card.Shaman);

        PanelBoardFront.GetComponent <ScrollableList>().Build(templates);

        PanelAvatar lasiaAvatar = PanelBoardFront.GetComponent <ScrollableList>().ElementsToPut[2 * 4 + 2].GetComponent <PanelTile>().PanelAvatar.GetComponent <PanelAvatar>();
        AvatarModel lasiaModel  = lasiaAvatar.Model;

        List <Card> all = new List <Card>();

        all.Add(Card.AncestralHealing);
        all.Add(Card.StonetuskBoar);
        all.Add(Card.RiverCrocolisk);
        all.Add(Card.Wolfrider);
        all.Add(Card.StormwindKnight);
        all.Add(Card.StormpikeCommando);
        all.Add(Card.RecklessRocketeer);
        all.Add(Card.WarGolem);
        all.Add(Card.Nightblade);
        all.Add(Card.LordOfTheArena);
        all.Add(Card.Archmage);
        all.Add(Card.GurubashiBerserker);
        all.Add(Card.DarkscaleHealer);
        all.Add(Card.BootyBayBodyguard);
        all.Add(Card.OgreMagi);
        all.Add(Card.OasisSnapjaw);
        all.Add(Card.DragonlingMechanic);
        all.Add(Card.SilverbackPatriarch);
        all.Add(Card.RaidLeader);
        all.Add(Card.MagmaRager);
        all.Add(Card.IronforgeRifleman);
        all.Add(Card.NoviceEngineer);
        all.Add(Card.Moonfire);
        all.Add(Card.DalaranMage);
        all.Add(Card.FrostwolfGrunt);
        all.Add(Card.GoldshireFootman);
        all.Add(Card.VoodooDoctor);
        all.Add(Card.ElvenArcher);
        all.Add(Card.MurlocTidehunter);
        all.Add(Card.HealingTouch);
        all.Add(Card.Innervate);
        all.Add(Card.MarkOfTheWild);
        all.Add(Card.IronfurGrizzly);
        all.Add(Card.SavageRoar);
        all.Add(Card.Claw);
        all.Add(Card.GnomishInventor);
        all.Add(Card.ChillwindYeti);
        all.Add(Card.Sprint);
        all.Add(Card.Flamestrike);
        all.Add(Card.CoreHound);
        all.Add(Card.KoboldGeomancer);
        all.Add(Card.RockbiterWeapon);
        all.Add(Card.Swipe);
        all.Add(Card.MindControl);
        all.Add(Card.Starfire);
        all.Add(Card.FlametongueTotem);
        all.Add(Card.RazorfenHunter);
        all.Add(Card.SenjinShieldmasta);
        all.Add(Card.Bloodlust);
        all.Add(Card.BoulderfishOgre);
        all.Add(Card.FireElemental);
        all.Add(Card.FrostwolfWarlord);
        all.Add(Card.Hex);
        all.Add(Card.StormwindChampion);
        all.Add(Card.ShatteredSunCleric);
        all.Add(Card.BloodfenRaptor);
        all.Add(Card.Thrallmar);
        all.Add(Card.Wisp);
        all.Add(Card.IronbarkProtector);

        all.Add(Card.KillTheBullies);
        all.Add(Card.BubblingVolcano);
        all.Add(Card.MagicArrow);

        all.RemoveAll(x => x.Cost > 5);

        all.Shuffle();

        lasiaModel.Deck = all.GetRange(0, 15);
        lasiaModel.PullCardFromDeck();
        lasiaModel.PullCardFromDeck();

        PanelAvatar dementorAvatar = PanelBoardFront.GetComponent <ScrollableList>().ElementsToPut[1].GetComponent <PanelTile>().PanelAvatar.GetComponent <PanelAvatar>();
        AvatarModel dementorModel  = dementorAvatar.Model;

        all.Shuffle();
        dementorModel.Deck = all.GetRange(0, 15);
        dementorModel.Hand.Add(Card.ManaCrystal);
        dementorModel.PullCardFromDeck();
        dementorModel.PullCardFromDeck();
        dementorModel.PullCardFromDeck();

        MyModel     = lasiaModel;
        EnemysModel = dementorModel;

        ActualTurnModel = EnemysModel;
        EndTurn();
        RevalidateEffects();
    }
Exemplo n.º 15
0
        private void FillTemplatesList(TileTemplate tTemp)
        {
            gridTTemp.SelectedObject = tTemp;

            FillTTempsList(tTemp);
        }
Exemplo n.º 16
0
        void ExportClicked(object sender, EventArgs e)
        {
            var dir = Path.Combine(Path.GetDirectoryName(srcfile), "output");

            Directory.CreateDirectory(dir);

            // Create a Tileset definition
            // Todo: Pull this info from the gui
            var tilesetFile = "tileset-arrakis.yaml";
            //var mixFile = "arrakis.mix";
            var tileset = new TileSet()
            {
                Name       = "Arrakis",
                Id         = "ARRAKIS",
                TileSize   = size,
                Palette    = "arrakis.pal",
                Extensions = new string[] { ".arr", ".shp" }
            };

            // List of files to add to the mix file
            List <string> fileList = new List <string>();

            // Export palette (use the embedded palette)
            var p = surface1.Image.Palette.Entries.ToList();

            fileList.Add(ExportPalette(p, Path.Combine(dir, tileset.Palette)));

            // Export tile artwork
            foreach (var t in surface1.Templates)
            {
                fileList.Add(ExportTemplate(t, surface1.Templates.IndexOf(t), tileset.Extensions.First(), dir));
            }

            // Add the terraintypes
            // Todo: add support for multiple/different terraintypes
            var terraintype = new TerrainTypeInfo()
            {
                Type         = "Clear",
                AcceptSmudge = true,
                IsWater      = false,
                Color        = Color.White
            };

            tileset.Terrain.Add("Clear", terraintype);

            // Add the templates
            ushort cur = 0;

            foreach (var tp in surface1.Templates)
            {
                var template = new TileTemplate()
                {
                    Id    = cur,
                    Image = "t{0:00}".F(cur),
                    Size  = new int2(tp.Width, tp.Height),
                };

                // Todo: add support for different terraintypes
                // Todo: restrict cells? this doesn't work: .Where( c => surface1.TerrainTypes[c.Key.X, c.Key.Y] != 0 )
                foreach (var t in tp.Cells)
                {
                    template.Tiles.Add((byte)((t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top)), "Clear");
                }

                tileset.Templates.Add(cur, template);
                cur++;
            }

            tileset.Save(Path.Combine(dir, tilesetFile));
            throw new NotImplementedException("NotI");
            //PackageWriter.CreateMix(Path.Combine(dir, mixFile),fileList);

            /*
             * // Cleanup
             * foreach (var file in fileList)
             *      File.Delete(file);
             *
             * Console.WriteLine("Finished export");
             */
        }
Exemplo n.º 17
0
        public void Export(string outputDir)
        {
            var dir = Path.Combine(Path.GetDirectoryName(srcfile), Platform.SupportDir + outputDir);

            Directory.CreateDirectory(dir);
            var tilesetName    = txtTilesetName.Text;
            var tilesetID      = txtID.Text;
            var tilesetPalette = txtPal.Text;
            var tilesetExt     = txtExt.Text;

            if (tilesetName.Length < 1)
            {
                tilesetName = "Temperat";
            }
            if (tilesetID.Length < 1)
            {
                tilesetID = "TEMPERAT";
            }
            if (tilesetPalette.Length < 1)
            {
                tilesetPalette = "temperat";
            }
            if (tilesetExt.Length < 1)
            {
                tilesetExt = ".tem,.shp";
            }

            // Create a Tileset definition
            // TODO: Pull this info from the GUI
            var tilesetFile = "";

            tilesetFile = tilesetName.ToLower();
            if (tilesetFile.Length < 8)
            {
                tilesetFile = tilesetName.ToLower() + ".yaml";
            }
            else
            {
                tilesetFile = tilesetName.ToLower().Substring(0, 8) + ".yaml";
            }

            var ext     = tilesetExt.Split(',');
            var tileset = new TileSet()
            {
                Name       = tilesetName,
                Id         = tilesetID.ToUpper(),
                Palette    = tilesetPalette.ToLower(),
                Extensions = new string[] { ext[0], ext[1] }
            };

            // List of files to add to the mix file
            List <string> fileList = new List <string>();

            // Export palette (use the embedded palette)
            var p = surface1.Image.Palette.Entries.ToList();

            fileList.Add(ExportPalette(p, Path.Combine(dir, tileset.Palette)));

            // Export tile artwork
            foreach (var t in surface1.Templates)
            {
                fileList.Add(ExportTemplate(t, surface1.Templates.IndexOf(t), tileset.Extensions.First(), dir));
            }

            // Add the terraintypes
            foreach (var tt in TerrainType)
            {
                tileset.Terrain.Add(tt.Type, tt);
            }

            // Add the templates
            ushort cur = 0;

            foreach (var tp in surface1.Templates)
            {
                var template = new TileTemplate()
                {
                    Id    = cur,
                    Image = "{0}{1:00}".F(txtTilesetName.Text, cur),
                    Size  = new int2(tp.Width, tp.Height),
                };

                foreach (var t in tp.Cells)
                {
                    string ttype = "Clear";
                    ttype = TerrainType[surface1.TerrainTypes[t.Key.X, t.Key.Y]].Type;
                    var idx = (t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top);
                    template.Tiles.Add((byte)idx, ttype);
                }

                tileset.Templates.Add(cur, template);
                cur++;
            }

            tileset.Save(Path.Combine(dir, tilesetFile));
            Console.WriteLine("Finished export");
        }
        private void TemplateList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TileTemplate tileTemplate = TemplateList.SelectedItem as TileTemplate;
            string       templateName = (tileTemplate != null) ? tileTemplate.Name : "TileSquare150x150Image";
            XmlDocument  tileXml      = TileUpdateManager.GetTemplateContent((TileTemplateType)TemplateList.SelectedIndex);

            OutputTextBlock.Text = MainPage.PrettyPrint(tileXml.GetXml().ToString());

            XmlNodeList tileTextAttributes = tileXml.GetElementsByTagName("text");

            for (int i = 0; i < TextInputs.Children.Count; i++)
            {
                if (i < tileTextAttributes.Length)
                {
                    TextInputs.Children[i].Visibility = Windows.UI.Xaml.Visibility.Visible;
                }
                else
                {
                    TextInputs.Children[i].Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
            }

            XmlNodeList tileImageAttributes = tileXml.GetElementsByTagName("image");

            for (int i = 0; i < ImageInputs.Children.Count; i++)
            {
                if (i < tileImageAttributes.Length)
                {
                    ImageInputs.Children[i].Visibility = Windows.UI.Xaml.Visibility.Visible;
                }
                else
                {
                    ImageInputs.Children[i].Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
            }

            Preview.Source = new BitmapImage(new Uri("ms-appx:///images/tiles/" + templateName + ".png"));

            // Show any available description against the preview tile.
            if (!String.IsNullOrEmpty(TilePreviewDescription.Text = previewTileImageDescriptions.GetString(templateName)))
            {
                TilePreviewDescription.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                TilePreviewDescription.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }

#if WINDOWS_PHONE_APP
            // Iconic templates are designed to handle the badge differently.
            if ((TileTemplateType)TemplateList.SelectedIndex == TileTemplateType.TileSquare71x71IconWithBadge ||
                (TileTemplateType)TemplateList.SelectedIndex == TileTemplateType.TileSquare150x150IconWithBadge ||
                (TileTemplateType)TemplateList.SelectedIndex == TileTemplateType.TileWide310x150IconWithBadgeAndText)
            {
                SendBadge.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                SendBadge.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
#endif
        }
Exemplo n.º 19
0
		public void Export(string outputDir)
		{
			var dir = Path.Combine(Path.GetDirectoryName(srcfile), Platform.SupportDir + outputDir);
			Directory.CreateDirectory(dir);
			var tilesetName = txtTilesetName.Text;
			var tilesetID = txtID.Text;
			var tilesetPalette = txtPal.Text;
			var tilesetExt = txtExt.Text;

			if (tilesetName.Length < 1) { tilesetName = "Temperat"; }
			if (tilesetID.Length < 1) { tilesetID = "TEMPERAT"; }
			if (tilesetPalette.Length < 1) { tilesetPalette = "temperat"; }
			if (tilesetExt.Length < 1) { tilesetExt = ".tem,.shp"; }

			// Create a Tileset definition
			// TODO: Pull this info from the GUI
			var tilesetFile = "";
			tilesetFile = tilesetName.ToLower();
			if (tilesetFile.Length < 8)
				tilesetFile = tilesetName.ToLower() + ".yaml";
			else
				tilesetFile = tilesetName.ToLower().Substring(0, 8) + ".yaml";

			var ext = tilesetExt.Split(',');
			var tileset = new TileSet(
				name: tilesetName,
				id: tilesetID.ToUpper(),
				palette: tilesetPalette.ToLower(),
				extensions: new string[] { ext[0], ext[1] },
				terrainInfo: TerrainType);

			// List of files to add to the mix file
			var fileList = new List<string>();

			// Export palette (use the embedded palette)
			var p = surface1.Image.Palette.Entries.ToList();
			fileList.Add(ExportPalette(p, Path.Combine(dir, tileset.Palette)));

			// Export tile artwork
			foreach (var t in surface1.Templates)
				fileList.Add(ExportTemplate(t, surface1.Templates.IndexOf(t), tileset.Extensions.First(), dir));

			// Add the templates
			ushort cur = 0;
			foreach (var tp in surface1.Templates)
			{
				var tiles = new int[tp.Width * tp.Height];
				foreach (var t in tp.Cells)
				{
					var ttype = TerrainType[surface1.TerrainTypes[t.Key.X, t.Key.Y]].Type;
					var idx = (t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top);
					tiles[idx] = tileset.GetTerrainIndex(ttype);
				}

				var template = new TileTemplate(
					id: cur,
					image: "{0}{1:00}".F(txtTilesetName.Text, cur),
					size: new int2(tp.Width, tp.Height),
					tiles: tiles);

				tileset.Templates.Add(cur, template);
				cur++;
			}

			tileset.Save(Path.Combine(dir, tilesetFile));
			Console.WriteLine("Finished export");
		}
Exemplo n.º 20
0
 public void Prepare(TileTemplate tt)
 {
     TileTemplate = tt;
     UpdateImage();
 }
Exemplo n.º 21
0
 public static extern string GetTemplate(TileTemplate templ);
Exemplo n.º 22
0
    /*static public TileStats[,] GenerateBaseMap(int width, int height, Tilemap ground, TileBase sprite)
     * {
     *  var map = new TileStats[width, height];
     *
     *      for(int i = 0; i < width; i++)
     *      {
     *          for(int t = 0; t < height; t++)
     *          {
     *              Vector3Int position = new Vector3Int(i, t, 0);
     *              map[i, t] = new TileStats(ground, position, sprite, i, t);
     *          }
     *      }
     *  return map;
     * }*/

    static public TileStats[,] GenerateBaseMap(int width, int height, Tilemap ground, TileTemplate template)
    {
        var map = new TileStats[width, height];

        for (int i = 0; i < width; i++)
        {
            for (int t = 0; t < height; t++)
            {
                Vector3Int position = new Vector3Int(i, t, 0);
                map[i, t] = new TileStats(ground, position, template, i, t);
            }
        }
        return(map);
    }
Exemplo n.º 23
0
 public void SetValues(TileTemplate template)
 {
     tileFace.GetComponent <MeshRenderer>().material = tileTemplate.tileSprite;
     template.suit   = suit;
     template.number = number;
 }