package dev.bytevibe.hyperpoint;

import java.io.Serializable;
import java.util.UUID;

/**
 * 表示幻灯片中的单个页面
 */
public class SlidePage implements Serializable {
    private String id;
    private String title;
    private String content; // 保留用于向后兼容
    private PageContent pageContent; // 新增：用于存储绘图对象

    public SlidePage() {
        this.id = UUID.randomUUID().toString();
        this.title = "新页面";
        this.content = "";
        this.pageContent = new PageContent();
    }

    public SlidePage(String title) {
        this.id = UUID.randomUUID().toString();
        this.title = title;
        this.content = "";
        this.pageContent = new PageContent();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public PageContent getPageContent() {
        if (pageContent == null) {
            pageContent = new PageContent();
        }
        return pageContent;
    }

    public void setPageContent(PageContent pageContent) {
        this.pageContent = pageContent;
    }

    @Override
    public String toString() {
        return title;
    }
}
