package com.bpa.scalage.data;

import android.content.Context;

import com.bpa.scalage.mode.Foods.FoodModel;
import com.bpa.scalage.mode.Foods.FoodTypes;
import com.bpa.scalage.mode.Order.AddSubOrder;
import com.bpa.scalage.mode.Order.BPA_Order;
import com.bpa.scalage.mode.Organize.OrganizeMode;
import com.bpa.scalage.mode.UserAndCart.UserAndCartMerge;
import com.bpa.scalage.mode.Users.UserModel;

import java.util.ArrayList;
import java.util.List;

/**
 * 单例模式
 * 数据中心
 */
public class DataBus {
    private static DataBus  mInstance; //实例变量设置私有，防止直接通过类名访问

    private DataBus() { //默认构造函数私有，防止类外直接new创建对象
    }

    public static synchronized DataBus getInstance() { //静态同步方法作为唯一的实例对象获取方式
        if (mInstance==null) {
            mInstance = new DataBus();
        }
        return mInstance;
    }


    //region 数据中心
    /**
     * 当前组织信息
     */
    public OrganizeMode organize=new OrganizeMode();
    /**
     * 商品类型集合
     */
    public List<FoodTypes> foodTypes=new ArrayList<>();
    /**
     * 菜品集合
     */
    public List<FoodModel> foodlist = new ArrayList<>();
    /**
     * 选中菜品
     */
    public FoodModel SelectFood;
    //endregion

    //region 当前操作卡号
    //当前卡号
    public  String CartNo="";
    //初始重量
    public int start_weight=0;
    //实时重量
    public int  weight=0;
    //消费重量
    public int  xf_weight=0;
    //消费金额
    public double  xf_price=0;
    //消费金额
    public double  xf_sjprice=0;
    //endregion

    //region 用户信息
    //当前卡与订单的关联关系
    public UserAndCartMerge selectMerge;
    //当前正在打菜的用户
    public UserModel selectuser;
    //准备提交的子订单
    public AddSubOrder addsuborder;
    public String Ch;
    //endregion

    //region 选择菜品界面
    public Context dishesCon;
    //endregion
}
