Пример #1
0
 public Board(Rect boardRect, PuzzlePanel puzzlePanel, E_HeroType heroType, MatchingHandler matchHandler, Handler onMatchStart, Handler onMatchFinish, TimeClient timeClient)
 {
     layout = new PuzzleLayout(boardRect);
     this.puzzlePanel = puzzlePanel;
     this.blocks = TableLoader.GetTable<BlockEntity>().GetMany(heroType).Select(x => x.Value).ToDictionary(x => x.BlockType);
     this.blockGenerator = new Block.Generator(heroType);
     this.matchHandler = matchHandler;
     this.onMatchStart = onMatchStart;
     this.onMatchFinish = onMatchFinish;
     fsm = new FSM("PuzzleBoard.fsm", this);
 }
Пример #2
0
    public Board(Rect boardRect, PuzzlePanel puzzlePanel, Dart<BlockEntity2> dart, bool permitStartingMatch, MatchingHandler matchHandler, Handler onMatchStart, Handler onMatchFinish, TimeClient timeClient)
    {
        layout = new PuzzleLayout(boardRect);
        this.puzzlePanel = puzzlePanel;
        this.blockGenerator = new Block.Generator(dart);
        this.matchHandler = matchHandler;
        this.onMatchStart = onMatchStart;
        this.onMatchFinish = onMatchFinish;
        fsm = new FSM("PuzzleBoard.fsm", this);

        this.typeToEntity = new Dictionary<BlockType, BlockEntity2>();
        foreach (var entity in dart.Values)
        {
            typeToEntity.Add(entity.blockType, entity);
        }

        FillWithoutAni();
        if (!permitStartingMatch)
        {
            RemoveMatch();
        }
    }
Пример #3
0
 SequenceWithRects(Sequence sequence, Block.Generator generator)
 {
     this.generator = generator;
     blocks = sequence.blocks;
     Fill();
 }