Ejemplo n.º 1
0
        internal void FromBytes(BinaryReader _br)
        {
            int id = _br.ReadInt32();

            sds = CookMain.getDishData(id);

            state = (DishState)_br.ReadByte();

            time = _br.ReadSingle();

            bool b = _br.ReadBoolean();

            if (b)
            {
                if (result == null)
                {
                    result = new DishResult();
                }

                result.FromBytes(_br);
            }
            else
            {
                result = null;
            }
        }
Ejemplo n.º 2
0
        internal virtual void FromBytes(BinaryReader _br)
        {
            int id = _br.ReadInt32();

            sds = CookMain.getResultData(id);

            isOptimized = _br.ReadBoolean();
        }
Ejemplo n.º 3
0
        internal void SetDishData(IList <int> _dish)
        {
            for (int i = 0; i < _dish.Count; i++)
            {
                DishData data = new DishData();

                IDishSDS sds = CookMain.getDishData(_dish[i]);

                data.sds = sds;

                dish.Add(data);
            }
        }
Ejemplo n.º 4
0
        private String Debug(byte[] _bytes)
        {
            using (MemoryStream ms = new MemoryStream(_bytes))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    CookMain cm = new CookMain();

                    cm.FromBytes(br);

                    return(cm.GetString());
                }
            }
        }
Ejemplo n.º 5
0
 public static void Init <T, U>(Dictionary <int, T> _dishDic, Dictionary <int, U> _resultDic) where T : IDishSDS where U : IResultSDS
 {
     CookMain.Init(_dishDic, _resultDic);
 }