Exemplo n.º 1
0
        public Tile DrawTile()
        {
            if (0 == Tiles.Count)
            {
                Tiles.AddRange(Tile.GreyTiles); // wow, the bag was empty
            }
            var i    = random.Next(0, Tiles.Count);
            var tile = Tiles[i];

            Tiles.RemoveAt(i);
            if (tile.IsEye())
            {
                SetAsideTiles.Add(tile);
            }
            return(tile);
        }
Exemplo n.º 2
0
        public void InitialDraw(List <Tile> tiles)
        {
            Tiles.AddRange(tiles);


            if (PlayerInitalWin != null && Tiles.Count == (IsDealer? 14: 13))
            {
                var kongMelds = MaJiangAlgorithm.GetKongs(Tiles);

                if (kongMelds.Any())
                {
                    PlayerInitalWin(this, new PlayerInitialWinEventArgs(InitialWinType.DaSiXi, kongMelds));
                }

                var triplets = MaJiangAlgorithm.GetTriplets(Tiles);
                if (triplets.Count >= 2)
                {
                    PlayerInitalWin(this, new PlayerInitialWinEventArgs(InitialWinType.LiuLiuShun, triplets));
                }

                var lackSuits = MaJiangAlgorithm.GetLackSuits(Tiles);
                if (lackSuits.Count > 0)
                {
                    PlayerInitalWin(this, new PlayerInitialWinEventArgs(InitialWinType.QueYiSe, lackSuits));
                }

                if (MaJiangAlgorithm.IsBanBanHu(Tiles))
                {
                    PlayerInitalWin(this, new PlayerInitialWinEventArgs(InitialWinType.BanBanHu));
                }
            }



            Order();
        }
Exemplo n.º 3
0
 internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
 {
     TilingPattern.AddRange(ParserSTEP.StripListLink(str, ref pos, len).ConvertAll(x => dictionary[x] as IfcVector));
     Tiles.AddRange(ParserSTEP.StripListLink(str, ref pos, len).ConvertAll(x => dictionary[x] as IfcStyledItem));
     TilingScale = ParserSTEP.StripDouble(str, ref pos, len);
 }
Exemplo n.º 4
0
 private void LoadTiles()
 {
     Tiles.AddRange(
         new List <Tile>
     {
         new Tile {
             Location = new Location(1, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(4, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(5, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(6, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(10, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(12, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 1), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 2), Mobile = new Mobile {
                 MobileId = Constants.MobileId.Player, DisplayCharacter = "@", Description = "This guy is a newb!!", HitMessage = "The player ", Name = "Player", HitPoints = 30, TransitionTable = null, CurrentTransition = null
             }, TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 2), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(5, 2), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(6, 2), TypeId = Constants.TypeIds.Door
         },
         new Tile {
             Location = new Location(7, 2), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(8, 2), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(9, 2), Mobile = new Mobile {
                 MobileId = Constants.MobileId.Bob, DisplayCharacter = "B", Description = "So plain it just bores you to death!", HitMessage = "Bob ", Name = "Bob", HitPoints = 20, TransitionTable = new BobTransitionTable(), CurrentTransition = (int)Transition.Rest
             }, TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(10, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(12, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 2), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 3), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(5, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(6, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 3), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(8, 3), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(9, 3), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(10, 3), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(11, 3), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(12, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 3), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 4), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(5, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(6, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(10, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 4), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(12, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 4), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 5), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 5), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(5, 5), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(6, 5), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(7, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(10, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 5), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(12, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 5), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 6), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(5, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(6, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 6), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(9, 6), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(10, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 6), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(12, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 6), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 7), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(5, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(6, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 7), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(10, 7), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(11, 7), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(12, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 7), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 8), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 8), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(5, 8), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(6, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 8), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(10, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(12, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 8), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 9), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 9), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(4, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(5, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(6, 9), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 9), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 9), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 9), Mobile = new Mobile {
                 MobileId = Constants.MobileId.Rat, DisplayCharacter = "r", Description = "A simple rat that wants to EAT you!", HitMessage = "the Rat ", Name = "Rat", HitPoints = 10, TransitionTable = null, CurrentTransition = (int)Transition.Rest
             }, TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(10, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(11, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(12, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(13, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(14, 9), TypeId = Constants.TypeIds.Floor
         },
         new Tile {
             Location = new Location(15, 9), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(1, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(2, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(3, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(4, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(5, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(6, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(7, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(8, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(9, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(10, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(11, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(12, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(13, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(14, 10), TypeId = Constants.TypeIds.Wall
         },
         new Tile {
             Location = new Location(15, 10), TypeId = Constants.TypeIds.Wall
         },
     });
 }
Exemplo n.º 5
0
 private void Start()
 {
     Tiles.AddRange(GetComponentsInChildren <WorldTile>().ToList().OrderBy(t => t.TileNum));
 }