Example #1
0
        public void SubStitueWallCat(TileCategory wallIn, TileCategory WallOut)
        {
            List <MultiTile> multi = new List <MultiTile>();

            foreach (var multiTile in MultiTiles.Where(multiTile => WallOut.FindTile(multiTile.ID) != null))
            {
                multi.Add(multiTile);
            }

            var tiles = wallIn.AllTiles();

            foreach (var multitile in multi)
            {
                foreach (var tIn in from tile in tiles select tile as TileWall into tIn let tOut = multitile.Tile as TileWall where tIn.Position == tOut.Position && tIn.PositionW == tOut.PositionW select tIn)
                {
                    multitile.SetTile(tIn);
                }
            }
        }
Example #2
0
        public void GenerateCandidates(MultiTile multiTile, TileCategory category)
        {
            var oldTileDescription = _tileData.GetItemTile(multiTile.Id);
            var tileinfo           = Categories.Select(c => c.FindTile(multiTile.Id)).FirstOrDefault(t => t != null);


            var candidates = category.AllTiles().Where(tile =>
                                                       tileinfo != null && (_tileData.GetItemTile(tile.Id).Height == oldTileDescription.Height &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Window) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Window) &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Wall) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Wall) &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Roof) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Roof) &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Surface) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Surface) &&
                                                                            tile.PositionString == tileinfo.PositionString)
                                                       );

            Candidates = new ObservableCollection <Tile>(candidates);
        }
        public void SubStitueWallCat(TileCategory wallIn, TileCategory WallOut)
        {
            List<MultiTile> multi = new List<MultiTile>();
            foreach (var multiTile in MultiTiles.Where(multiTile => WallOut.FindTile(multiTile.ID)!=null))
            {
                multi.Add(multiTile);
            }

            var tiles = wallIn.AllTiles();

            foreach (var multitile in multi)
            {
                foreach (var tIn in from tile in tiles select tile as TileWall into tIn let tOut = multitile.Tile as TileWall where tIn.Position == tOut.Position && tIn.PositionW == tOut.PositionW select tIn)
                {
                    multitile.SetTile(tIn);
                }
            }

        }
        public void GenerateCandidates(MultiTile multiTile, TileCategory category)
        {
            var oldTileDescription = _tileData.GetItemTile(multiTile.Id);
            var tileinfo = Categories.Select(c=>c.FindTile(multiTile.Id)).FirstOrDefault(t => t!=null);
            

            var candidates = category.AllTiles().Where(tile =>
                                                       tileinfo != null && (_tileData.GetItemTile(tile.Id).Height == oldTileDescription.Height &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Window) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Window) &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Wall) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Wall) &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Roof) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Roof) &&
                                                                            oldTileDescription.Flags.HasFlag(TileFlag.Surface) ==
                                                                            _tileData.GetItemTile(tile.Id).Flags.HasFlag(TileFlag.Surface)
                                                                            && tile.PositionString == tileinfo.PositionString)
                                                       );
            
            Candidates= new ObservableCollection<Tile>(candidates);
        }