예제 #1
0
        private void SetTest(TrendData data, TrendNormalItem item)
        {
            RoadNodeTable testBankerRoad = new RoadNodeTable(_datas);

            testBankerRoad.AddSingleItem(data);
            RoadNodeTable viewTable = new RoadNodeTable(testBankerRoad, Type, 6);

            if (testBankerRoad.Nodes.Count > 0)
            {
                switch (Type)
                {
                case EnumTrendType.BigRoad:
                    break;

                default:
                    viewTable.AddSingleItem(testBankerRoad.Nodes.Last(), testBankerRoad);
                    break;
                }
            }
            if (viewTable.Nodes.Count > 0)
            {
                var lastNode = viewTable.Nodes.Last();
                var isRed    = lastNode.IsRed ? ConstantData.KeyBetBanker : ConstantData.KeyBetLeisure;
                item.ResultType.TrySetComponentValue(string.Format(item.SpriteFormat, isRed));
            }
            else
            {
                item.ResultType.spriteName = "9999";
            }
        }
예제 #2
0
        protected override void OnSingleRecord(IRecycleData data)
        {
            var itemData = data as TrendData;

            if (_datas == null)
            {
                _datas = new RoadNodeTable(new List <TrendData>(), 6);
            }
            if (_branchDatas == null)
            {
                switch (Type)
                {
                case EnumTrendType.BigRoad:
                    _branchDatas = _datas;
                    break;

                default:
                    _branchDatas = new RoadNodeTable(_datas, Type, 6);
                    break;
                }
            }
            if (itemData != null)
            {
                if (!_datas.AddSingleItem(itemData))
                {
                    if (CacheData.Count > 0)
                    {
                        var cachelast = CacheData.Last() as RoadNode;
                        var getLast   = _datas.Nodes.Last();
                        if (cachelast != null && (cachelast.X == getLast.X && cachelast.Y == getLast.Y))
                        {
                            var lastView = CacheViews.Last();
                            CacheData[CacheData.Count - 1] = getLast;
                            lastView.UpdateView(getLast);
                        }
                    }
                }
                else
                {
                    switch (Type)
                    {
                    case EnumTrendType.BigRoad:
                        _branchDatas = _datas;
                        break;

                    default:
                        _branchDatas.AddSingleItem(_datas.Nodes.Last(), _datas);
                        break;
                    }
                    if (_branchDatas.Nodes.Count > 0)
                    {
                        var lastNode = _branchDatas.Nodes.Last();
                        AddChildToShow(lastNode);
                    }
                }
            }
            GetPridict();
        }