Beispiel #1
0
        private void Parse45300(Packet packet)
        {
            var token = JToken.Parse(packet.Message);

            myTeam = WeaveTeamDetail.Parse(token);
            if (myTeam.Action == WeaveTeamAction.Changed)
            {
                var oldSelectedIndex = memberList.SelectedIndex;
                memberList.SetObjects(myTeam.Members, true);
                memberList.SelectedIndex = oldSelectedIndex;

                teamLevelLabel.Text = String.Format("Cấp: {0}", myTeam.Level);
                teamPriceLabel.Text = String.Format("Giá: {0} - {1}", myTeam.Cost, myTeam.Price);
                teamRateLabel.Text  = String.Format("Tỉ lệ: {0} - {1}", myTeam.SuccessRate, myTeam.CriticalRate);

                CheckAutoMake();
                return;
            }
            if (myTeam.Action == WeaveTeamAction.Produced)
            {
                memberList.ClearObjects();
                return;
            }
            if (myTeam.Action == WeaveTeamAction.Disbanded)
            {
                memberList.ClearObjects();
                return;
            }
            if (myTeam.Action == WeaveTeamAction.Kicked)
            {
                memberList.ClearObjects();
                return;
            }
            Debug.Assert(false);
        }
Beispiel #2
0
        public static WeaveTeamDetail Parse(JToken token)
        {
            var result = new WeaveTeamDetail();

            result.Action = (WeaveTeamAction)(int)token["type"];
            if (result.Action == WeaveTeamAction.Changed)
            {
                var teamObject = token["teamObject"];
                Debug.Assert(teamObject != null);

                result.Level          = (int)teamObject["level"];
                result.Id             = (int)teamObject["teamid"];
                result.SuccessRate    = (string)teamObject["succrate"];
                result.CriticalRate   = (string)teamObject["baojirate"];
                result.Cost           = (int)teamObject["cost"];
                result.Price          = (int)teamObject["price"];
                result.LeaderId       = (int)teamObject["leaderid"];
                result.PlayerCount    = (int)teamObject["num"];
                result.MaxPlayerCount = (int)teamObject["maxnum"];
                result.limit          = (int)teamObject["limit"];

                var memberList = teamObject["memberlist"];
                var members    = new List <WeaveMember>();
                foreach (var memberToken in memberList)
                {
                    var member = WeaveMember.Parse(memberToken);
                    members.Add(member);
                }
                result.Members = members;
            }
            return(result);
        }
Beispiel #3
0
        public WeaveView()
        {
            InitializeComponent();

            weaveInfo = null;
            myTeam    = null;

            isRefreshing = false;
            isMaking     = false;

            teamColumn.AspectGetter = (obj) => {
                var team = (WeaveTeam)obj;
                return(String.Format("{0} Lv. {1} ({2}/{3}) [{4} - {5}] [{6} - {7}]",
                                     team.Name, team.Level, team.PlayerCount, team.MaxPlayerCount,
                                     team.Cost, team.Price, team.SuccessRate, team.CriticalRate));
            };

            memberColumn.AspectGetter = (obj) => {
                var member = (WeaveMember)obj;
                return(String.Format("{0} Lv. {1} - Công nhân {2}",
                                     member.Name, member.Level, member.SpinnerLevel));
            };
        }