Esempio n. 1
0
 public BotViewModel(ICompetitor competitor)
 {
     Competitor    = competitor;
     Wins          = 0;
     Loses         = 0;
     PlayAgainstId = new HashSet <Guid>();
 }
Esempio n. 2
0
 public Team(ICompetitor c)
 {
     SpielerListe = new List <ICompetitor> {
         c
     };
     CalcTeamSkillLevel();
 }
Esempio n. 3
0
 public AntModel(AntViewModel viewModel, ICompetitor competitor)
     : base(competitor)
 {
     Competitor = competitor;
     ViewModel  = viewModel;
     InitiateMovementShadow();
 }
Esempio n. 4
0
 public BotViewModel(ICompetitor competitor)
 {
     Competitor = competitor;
     Wins = 0;
     Loses = 0;
     PlayAgainstId = new HashSet<Guid>();
 }
Esempio n. 5
0
 public Competitor(ICompetitor competitor)
 {
     Id          = competitor.Id;
     Url         = competitor.Url;
     Description = competitor.Description;
     AvatarUrl   = competitor.AvatarUrl;
     Name        = competitor.Name;
 }
Esempio n. 6
0
 /// <summary>
 /// Füge Teilnehmer dem Turnier hinzu solange das Turnier noch nicht gestartet ist
 /// </summary>
 /// <param name="c">Teilnehmer der hinzugefügt wird</param>
 public void AddCompetitor(ICompetitor c)
 {
     // Teilnehmer können nur hinzugefügt werden wenn das Tournament noch nicht gestartet ist
     if (!IsStarted)
     {
         _competitorList.Add(c);
     }
 }
Esempio n. 7
0
 public CubeModel(CubeViewModel viewModel, ICompetitor competitor, int width, int heigth)
     : base(competitor)
 {
     Competitor  = competitor;
     _cubeWidth  = width;
     _cubeHeigth = heigth;
     ViewModel   = viewModel;
     InitiateMovementShadow();
 }
Esempio n. 8
0
 public AntModel(AntViewModel viewModel, ICompetitor competitor)
     : base(competitor)
 {
     _antHeigth = 0;
     _antWidth  = 0;
     Competitor = competitor;
     ViewModel  = viewModel;
     InitiateMovementShadow();
 }
 public DetailedChampionshipResult(ICompetitor competitor, Season season)
 {
     Competitor = competitor;
     Races = season.Races.Count();
     Results = new RaceResult[Races];
     for (var i = 0; i < Races; i++)
     {
         Results[i] = new NullRaceResult(competitor, season);
     }
 }
 public static void SetLeadCompetitorDefaultsStep( ILeadCompetitor leadcompetitor,  ICompetitor competitor)
 {
     leadcompetitor.Competitor = competitor;
     leadcompetitor.RATING = competitor.Rating;
     leadcompetitor.STRENGTHS = competitor.Strengths;
     leadcompetitor.WEAKNESSES = competitor.Weaknesses;
     leadcompetitor.STRATEGY = competitor.Strategy;
     leadcompetitor.Notes = competitor.Notes;
     leadcompetitor.INCUMBENT = false;
 }
        /// <summary>
        /// Invokes the association lookup for competitors.
        /// </summary>
        /// <param name="form">the instance of the OpportunityCompetitor dialog</param>
        /// <param name="args">empty</param>
        public static void lueAssociateCompetitor_OnChangeStep(IOpportunityCompetitors form, EventArgs args)
        {
            if (form.lueAssociateCompetitor.LookupResultValue != null)
            {
                IOpportunity parentEntity  = form.CurrentEntity as IOpportunity;
                ICompetitor  relatedEntity = form.lueAssociateCompetitor.LookupResultValue as ICompetitor;
                var          dialogService = form.Services.Get <IWebDialogService>();

                if ((parentEntity != null) && (relatedEntity != null))
                {
                    if (parentEntity.Competitors.Any(oc => oc.Competitor == relatedEntity))
                    {
                        if (dialogService != null)
                        {
                            string msg = string.Format(form.GetResource("DuplicateCompetitorMsg").ToString(), relatedEntity.CompetitorName);
                            dialogService.ShowMessage(msg, form.GetResource("DuplicateCompetitorMsgTitle").ToString());
                        }
                    }
                    else
                    {
                        IOpportunityCompetitor relationshipEntity = EntityFactory.Create <IOpportunityCompetitor>();
                        relationshipEntity.Opportunity = parentEntity;
                        relationshipEntity.Competitor  = relatedEntity;
                        parentEntity.Competitors.Add(relationshipEntity);

                        if (!MySlx.MainView.IsInsertMode())
                        {
                            parentEntity.Save();
                        }

                        if (dialogService != null)
                        {
                            dialogService.SetSpecs(0, 0, 400, 600, "EditOpportunityCompetitor", string.Empty, true);
                            dialogService.EntityType = typeof(IOpportunityCompetitor);
                            string id;

                            dialogService.CompositeKeyNames = "OpportunityId,CompetitorId";
                            if (PortalUtil.ObjectIsNewEntity(relationshipEntity))
                            {
                                id = relationshipEntity.InstanceId.ToString();
                                ChangeManagementEntityFactory.RegisterInstance(relationshipEntity, relationshipEntity.InstanceId);
                                relationshipEntity.SetOppCompetitorDefaults(relatedEntity);
                            }
                            else
                            {
                                id = string.Format("{0},{1}", relationshipEntity.OpportunityId, relationshipEntity.CompetitorId);
                            }
                            dialogService.EntityID = id;
                            dialogService.ShowDialog();
                        }
                    }
                }
                form.lueAssociateCompetitor.LookupResultValue = null; //34026
            }
        }
Esempio n. 12
0
 /// <summary>
 /// Adds the selected competitor as a new opportunity competitor.
 /// </summary>
 /// <param name="form">The form.</param>
 /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 public static void LoadAction1Step1(IOpportunityCompetitors form, EventArgs args)
 {
     Sage.Platform.WebPortal.SmartParts.WebActionEventArgs e = args as Sage.Platform.WebPortal.SmartParts.WebActionEventArgs;
     if (e != null)
     {
         ICompetitor            competitor            = form.lueAssociateCompetitor.LookupResultValue as ICompetitor;
         IOpportunityCompetitor opportunityCompetitor = e.PassThroughObject as IOpportunityCompetitor;
         if (opportunityCompetitor != null && competitor != null)
         {
             opportunityCompetitor.SetOppCompetitorDefaults(competitor);
         }
     }
     form.lueAssociateCompetitor.LookupResultValue = null;             //34026
 }
Esempio n. 13
0
        private BotUserControl ReturnBotControl(ICompetitor botClient)
        {
            BotUserControl botUserControl = null;

            foreach (var stageList in _tournamentLadderViewModel.StageLists)
            {
                var tempViewControl = stageList.FirstOrDefault(f => f.ViewModel.BotClient != null && f.ViewModel.BotClient.Id == botClient.Id);
                if (tempViewControl != null)
                {
                    botUserControl = tempViewControl;
                }
            }

            return(botUserControl);
        }
Esempio n. 14
0
        /// <summary>
        /// Sets the flag, LostReplaced, on the opportunity competitor indicating that this opportunity
        /// competitor was associated as a competitor lost to.
        /// </summary>
        /// <param name="form">The opportunity closed lost form.</param>
        /// <param name="args">The event arguments.<see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void lueCompetitorLoss_OnChange(IOpportunityClosedLost form, EventArgs args)
        {
            ICompetitor competitor = form.lueCompetitorLoss.LookupResultValue as ICompetitor;

            if (competitor != null)
            {
                IOpportunity opportunity = form.CurrentEntity as IOpportunity;
                opportunity.SetOppCompetitorReplacedFlag(competitor);
            }

            Sage.Platform.WebPortal.Services.IPanelRefreshService panelRefresh = form.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
            if (panelRefresh != null)
            {
                panelRefresh.RefreshMainWorkspace();
            }
        }
Esempio n. 15
0
        public void AddScore(ICompetitor player, double score, ICompetitor oponent)
        {
            if (_scoreDictionary.Count == 0 || !_scoreDictionary.Any(f => f.Key.Equals(player)))
            {
                var gameScoreList = new List <GameScore>
                {
                    new GameScore(oponent, score)
                };

                _scoreDictionary.Add(player, gameScoreList);
            }
            else
            {
                var playerRecord = _scoreDictionary.First(f => f.Key.Equals(player));
                var gameScore    = new GameScore(oponent, score);

                playerRecord.Value.Add(gameScore);
            }
        }
Esempio n. 16
0
        public void AddScore(ICompetitor player, double score, ICompetitor oponent)
        {
            if (_scoreDictionary.Count == 0 || !_scoreDictionary.Any(f => f.Key.Equals(player)))
            {
                var gameScoreList = new List<GameScore>
                {
                    new GameScore(oponent, score)
                };

                _scoreDictionary.Add(player, gameScoreList);
            }
            else
            {
               var playerRecord = _scoreDictionary.First(f => f.Key.Equals(player));
               var gameScore = new GameScore(oponent, score);

               playerRecord.Value.Add(gameScore);
            }
        }
Esempio n. 17
0
 public GameScore(ICompetitor oponent, double score)
 {
     Score   = score;
     Oponent = oponent;
 }
Esempio n. 18
0
 public TicTacToeLocalBot(ICompetitor competitor) : base(competitor)
 {
 }
Esempio n. 19
0
 public BotClientBase(ICompetitor competitor) : base(competitor)
 {
 }
Esempio n. 20
0
 public void Detach(ICompetitor competitor)
 {
     _competitors.Remove(competitor);
 }
Esempio n. 21
0
 public void Attach(ICompetitor competitor)
 {
     _competitors.Add(competitor);
 }
Esempio n. 22
0
 public GameOverException(ICompetitor winner, int totalShots = 0) : base("GAME OVER!")
 {
     Winner     = winner;
     TotalShots = totalShots;
 }
Esempio n. 23
0
 private BotViewModel ReturnWrappedBot(ICompetitor competitor)
 {
     return _viewModel.Bots.FirstOrDefault(bot => bot.Competitor.Id == competitor.Id);
 }
Esempio n. 24
0
 public List<GameScore> ShowGameScoresForPlayer(ICompetitor competitor)
 {
     return _scoreDictionary.FirstOrDefault(f => f.Key.Id == competitor.Id).Value;
 }
Esempio n. 25
0
 public NullRaceResult(ICompetitor competitor, Season season)
     : base(new RaceEntry() { Entrant = new DriverContract() { Driver = new Driver(), Season = season, Team = new Team() }, Race = new Race() { Season = season } })
 {
     Completed = false;
     Position = 0;
 }
Esempio n. 26
0
        private BotUserControl ReturnBotControl(ICompetitor botClient)
        {
            BotUserControl botUserControl = null;

            foreach (var stageList in _tournamentLadderViewModel.StageLists)
            {
                var tempViewControl = stageList.FirstOrDefault(f => f.ViewModel.BotClient != null && f.ViewModel.BotClient.Id == botClient.Id);
                if (tempViewControl != null) { botUserControl = tempViewControl; }
            }

            return botUserControl;
        }
 public DetailedDriverChampionshipResult(ICompetitor competitor, Season season)
     : base(competitor, season)
 {
 }
Esempio n. 28
0
 public HitBoard(ICompetitor owner, ICompetitor rival, in int dim) : base(dim)
Esempio n. 29
0
 public GameScore(ICompetitor oponent, double score)
 {
     Score = score;
     Oponent = oponent;
 }
Esempio n. 30
0
 public TankBlasterBot(ICompetitor competitor) : base(competitor)
 {
     LastMissileFiredRound = Int32.MinValue;
 }
Esempio n. 31
0
 private BotViewModel ReturnWrappedBot(ICompetitor competitor)
 {
     return(_viewModel.Bots.FirstOrDefault(bot => bot.Competitor.Id == competitor.Id));
 }
Esempio n. 32
0
 public List <GameScore> ShowGameScoresForPlayer(ICompetitor competitor)
 {
     return(_scoreDictionary.FirstOrDefault(f => f.Key.Id == competitor.Id).Value);
 }
Esempio n. 33
0
 public List<GameScore> ScoreAgainstPlayer(ICompetitor competitor, ICompetitor oponent)
 {
     return _scoreDictionary.FirstOrDefault(f => f.Key.Id == competitor.Id).Value.Where(f=>f.Oponent.Id == oponent.Id).ToList();
 }
Esempio n. 34
0
 public List <GameScore> ScoreAgainstPlayer(ICompetitor competitor, ICompetitor oponent)
 {
     return(_scoreDictionary.FirstOrDefault(f => f.Key.Id == competitor.Id).Value.Where(f => f.Oponent.Id == oponent.Id).ToList());
 }
Esempio n. 35
0
 public UserMismatchingException(ICompetitor User) : base()
 {
     Console.WriteLine($"{User.GetName()}无权限使用技能");
 }
Esempio n. 36
0
 public TicTacToeLocalBot(ICompetitor competitor) : base(competitor)
 {
 }
Esempio n. 37
0
 public void RegisterPlayer(ICompetitor player)
 {
     players.Add(player);
 }
Esempio n. 38
0
 public TicTacToeWebBot(ICompetitor competitor)
     : base(competitor)
 {
 }