Ejemplo n.º 1
0
        private void btnAskInterest_Click(object sender, EventArgs e)
        {
            int relationshipIndex = _Agent.RelationshipsWithTeams.FindIndex(o => o.Team == _League.TeamList[cbTeamList.SelectedIndex]);

            if (relationshipIndex < 0)
            {
                relationship = new RelationshipWithTeam(_League.TeamList[cbTeamList.SelectedIndex], 50);
                _Agent.RelationshipsWithTeams.Add(relationship);
            }
            else
            {
                relationship = _Agent.RelationshipsWithTeams[relationshipIndex];
            }

            foreach (RelationshipWithTeam r in _Agent.RelationshipsWithTeams)
            {
                Console.WriteLine("Team: " + r.Team.Mascot + ", Relationship: " + r.Relationship);
            }

            lblTeamInterestLevel.Text = "Interest In Signing: " + _InterestLevel;
        }
Ejemplo n.º 2
0
 private void FindAgentTeamRelationship()
 {
     _Relationship = _Agent.RelationshipsWithTeams[_Agent.RelationshipsWithTeams.FindIndex(o => o.Team == _Team)];
     Console.WriteLine("Relationship #: " + _Relationship.Relationship);
 }
Ejemplo n.º 3
0
        private void GenerateTeamInterest()
        {
            btnAcceptOffer.Enabled = false;
            bool goodRelationshipWithTeam = false;
            int  relationshipIndex        = _Agent.RelationshipsWithTeams.FindIndex(o => o.Team == _League.TeamList[cbTeamList.SelectedIndex]);

            //see if agent has current relationship with team
            if (relationshipIndex >= 0)
            {
                relationship = _Agent.RelationshipsWithTeams[relationshipIndex];
                //see if current relationship is a good one
                if (relationship.Relationship >= 75)
                {
                    goodRelationshipWithTeam = true;
                }
            }
            //if not, create a new relationship for with this team
            else
            {
                _Agent.RelationshipsWithTeams.Add(new RelationshipWithTeam(_League.TeamList[cbTeamList.SelectedIndex], 50));
            }

            string interestLevel = "";

            //would free agent be a starter?
            if (_Client.CurrentSkill > _PositionPlayers[0].CurrentSkill)
            {
                //is current starter a young stud?
                if (_PositionPlayers[0].Age <= 25 && _PositionPlayers[0].PotentialSkill >= 70)
                {
                    interestLevel = "HIGH";
                }
                else
                {
                    interestLevel = "VERY HIGH";
                }
            }
            else if (_Client.CurrentSkill > _PositionPlayers[_PositionPlayers.Count - 1].CurrentSkill)
            {
                //is lowest ranked player at position a young player with more potential?
                if (_PositionPlayers[_PositionPlayers.Count - 1].Age <= 25 && _PositionPlayers[_PositionPlayers.Count - 1].PotentialSkill > _Client.PotentialSkill)
                {
                    if (goodRelationshipWithTeam)
                    {
                        //good relationship gains your client a little more love from team
                        interestLevel = "LOW";
                    }
                    else
                    {
                        //not playing over young developmental prospect
                        interestLevel = "VERY LOW";
                    }
                }
                else
                {
                    //starter much better than client
                    if (_PositionPlayers[0].CurrentSkill >= _Client.CurrentSkill + 25)
                    {
                        if (goodRelationshipWithTeam)
                        {
                            interestLevel = "MEDIUM";
                        }
                        else
                        {
                            interestLevel = "LOW";
                        }
                    }
                    else
                    {
                        if (goodRelationshipWithTeam)
                        {
                            interestLevel = "HIGH";
                        }
                        else
                        {
                            interestLevel = "MEDIUM";
                        }
                    }
                }
            }
            else
            {
                interestLevel = "ZERO INTEREST";
            }

            _InterestLevel = interestLevel;
        }