Exemple #1
0
        public Piece(ChessColor player, PieceType type, int col, int line)
        {
            this.instanceIdx = nextInstanceIdx++;
            this.Type        = type;
            this.Player      = player;
            initX            = col;
            initY            = line;
            position.X       = initX;
            position.Y       = initY;
            BoardCell        = new Crow.Point(col, line);

            instData = new VkChess.InstanceData(Player == ChessColor.White ? whiteColor : blackColor, Matrix4x4.Identity);

            if (player == ChessColor.Black && type == PieceType.Knight)
            {
                zAngle = MathHelper.Pi;
            }

            updatePos();
        }
Exemple #2
0
        public static void UpdateBuff(uint instIdx, ref VkChess.InstanceData data)
        {
            if (instanceBuff == null)
            {
                return;
            }
            instanceBuff.Update(instIdx, data);

            if (flushEnd == 0)
            {
                flushStart = instIdx;
                flushEnd   = instIdx + 1;
            }
            else if (instIdx < flushStart)
            {
                flushStart = instIdx;
            }
            else if (flushEnd <= instIdx)
            {
                flushEnd = instIdx + 1;
            }
        }