Пример #1
0
 private void AddDef(TileType tileType, int count = 1)
 {
     for (int i = 1; i <= count; i++)
     {
         var def = new TileParams()
         {
             Type = tileType
         };
         _list.Add(def);
     }
 }
Пример #2
0
 private void AddArrowDef(int arrowsCode, int count)
 {
     for (int i = 1; i <= count; i++)
     {
         var def = new TileParams()
         {
             Type = TileType.Arrow, ArrowsCode = arrowsCode
         };
         _list.Add(def);
     }
 }
Пример #3
0
 private void AddSpinningDef(int spirnningCount, int count)
 {
     for (int i = 1; i <= count; i++)
     {
         var def = new TileParams()
         {
             Type = TileType.Spinning, SpinningCount = spirnningCount
         };
         _list.Add(def);
     }
 }
Пример #4
0
        public Tile(TileParams tileParams)
        {
            Position = tileParams.Position;
            Type     = tileParams.Type;
            int levelsCount = (tileParams.Type == TileType.Spinning) ? tileParams.SpinningCount : 1;

            for (int level = 0; level < levelsCount; level++)
            {
                var tileLevel = new TileLevel(new TilePosition(tileParams.Position, level));
                Levels.Add(tileLevel);
            }
            ArrowsCode      = tileParams.ArrowsCode;
            SpinningCount   = tileParams.SpinningCount;
            CannonDirection = tileParams.CanonDirection;
        }