import { _decorator, Node, Sprite } from "cc";
const { ccclass, property } = _decorator;

@ccclass("Fruit")
export class Fruit {
    id: number = 0;
    type: string = 'watermelon';
    level: number = 1;
    node: Node = null!;
    row: number = 0;
    col: number = 0;

    constructor(node: Node, row: number, col: number, level: number = 1) {
        this.node = node;
        this.row = row;
        this.col = col;
        this.level = level;
    }

    setSprite(sprite: Sprite) {
        this.node.getComponent(Sprite)!.spriteFrame = sprite.spriteFrame;
    }
}
