Esempio n. 1
0
 void OnCollisionExit(Collision col)
 {
     //各変数の初期化
     table = null;
     exe   = null;
     kit   = null;
 }
Esempio n. 2
0
 public TableDescriptor(TableKind p_kind, KaitaiStream p__io, AndroidSuper.Metadata p__parent = null, AndroidSuper p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     _kind    = p_kind;
     f_table  = false;
     _read();
 }
Esempio n. 3
0
 public override void SetParent(Solution solution, String name, TableKind kind)
 {
     base.SetParent(solution, name, kind);
     if (fields != null)
     {
         foreach (var f in fields)
         {
             f.Value.SetParent(solution, f.Key, TableKind.field);
         }
     }
     if (details != null)
     {
         foreach (var d in details)
         {
             d.Value.SetParent(solution, d.Key, TableKind.details);
             d.Value._parentTable = this;
         }
     }
 }
Esempio n. 4
0
        public uint ReadTableIndex(TableKind table)
        {
            ushort mask = ushort.MaxValue;

            int length = this.tableStream.Tables[(int)table].Length;

            uint index;

            if ((length & ~mask) == 0)
            {
                index = this.Binary.ReadUInt16();
            }
            else
            {
                index = this.Binary.ReadUInt32();
            }

            if (index > length + 1)
            {
                throw new FormatException("Index " + index + " is out of range [0.." + length + "] for " + table + " table.");
            }

            return(index);
        }
Esempio n. 5
0
        /// <summary>
        /// 根据数据库类型与表的种类获取DataSourceName与实体类型的映射关系。
        /// </summary>
        /// <returns>一个字典对象,Key表示DataSourceName,Value表示实体类型集合。</returns>
        public static Dictionary <string, IEnumerable <Type> > GetDataSrcNameEntityMapping(DataBaseType dbType, TableKind tableKind)
        {
            // 获取指定种类的表的类型。
            var theTableTypes = TableDescriptors.Values.Where(p => p.TableKind == tableKind).Select(p => p.EntityType);

            // 获取指定数据类类型的映射。
            var sqliteSrcNames = DataSources.Values.Where(p => (DataBaseType)p.DbType == dbType).Select(p => p.Name);
            var theMapping     = DataSources.Where(p => sqliteSrcNames.Contains(p.Key)).ToDictionary(p => p.Key, q => q.Value.TableDescriptors.Select(k => k.Value.EntityType));

            // 构建 DataSourceName 与 Entity 的映射。
            return(theMapping.Where(p => p.Value.Intersect(theTableTypes).Any()).ToDictionary(p => p.Key, q => q.Value.Intersect(theTableTypes)));
        }
Esempio n. 6
0
 /// <summary>
 /// 获取指定种类的表描述符。
 /// </summary>
 public static IEnumerable <TableDescriptor> GetTableDescriptors(TableKind tableKind)
 {
     return(TableDescriptors.Values.Where(p => p.TableKind == tableKind));
 }
Esempio n. 7
0
 public virtual void SetParent(Solution solution, String name, TableKind kind)
 {
     _solution = solution;
     this.name = name;
     this.Kind = kind;
 }
Esempio n. 8
0
    void OnCollisionStay(Collision col)
    {
        //各コントローラーのAction1ボタンが押されたら
        if (Input.GetButtonDown(setting.keyAction))
        {
            //衝突した机の種類を取得、tableKindがついていないオブジェクトだったら処理を中断
            table = col.gameObject.GetComponent(typeof(TableKind)) as TableKind;
            if (table == null)
            {
                return;
            }

            //衝突した机のinterfaceを取得する
            exe = col.gameObject.GetComponent(typeof(IExecutable)) as IExecutable;
            kit = col.gameObject.GetComponent(typeof(IKitchenWare)) as IKitchenWare;

            switch (table.type)
            {
            //素材テーブル
            case TableType.ElemTable:

                SetGet_exe();
                break;

            //こねるテーブル
            case TableType.KneadTable:

                knead = col.gameObject.GetComponent <KneadTable>();

                //入れる
                if (knead.elemLis.Count < 2 && ElemType() && knead.createDone == null)
                {
                    KneadSetGet_kit();
                    Destroy(haveObj);
                }
                //出す
                else if (knead.createDone != null && HaveChildObj() == false && knead.CheckProgress() == 1)
                {
                    KneadSetGet_kit();
                    knead.createDone = null;
                }

                break;

            //オーブン
            case TableType.BakingTable:

                bake = col.gameObject.GetComponent <BakingTable>();

                //入れる
                if (KneadType() && bake.elemLis.Count <= 0 && bake.createDone == null)
                {
                    OvenSetGet_kit();
                    Destroy(haveObj);
                }
                //出す
                else if (bake.createDone != null && HaveChildObj() == false && bake.CheckProgress() == 1)
                {
                    OvenSetGet_kit();
                    bake.createDone = null;
                }

                break;

            //コンベア
            case TableType.ExitTable:

                ExitTable exit = col.gameObject.GetComponent <ExitTable>();

                //入れる
                if (HaveChildObj() && BakingType(exit))
                {
                    exe.SetElement(haveObjMat);
                    haveObjMat = null;
                    Destroy(haveObj);
                }
                //出す
                else if (haveObjMat != null && BakingType(exit) == false)
                {
                    exit.missImg.SetActive(true);
                }

                break;
            }
        }
    }