Ejemplo n.º 1
0
 public void AddParticipant(String newParticipant)
 {
     Participants.Add(newParticipant);
 }
Ejemplo n.º 2
0
 public Participant GetParticipant(string name) =>
 Participants.FirstOrDefault(p => p.Name == name);
Ejemplo n.º 3
0
        public void TestGettingPagedParticipantsList()
        {
            // Arrange

            // The URI we are using in the test
            var requestUri    = new Uri("https://localhost/api/admin/status/v1/participant/");
            var requestUriTwo = new Uri("https://localhost/api/admin/status/v1/participant/?limit=20&offset=20");

            // Page 1
            List <ParticipantsObject> testParticipantsList = new List <ParticipantsObject>();

            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });
            testParticipantsList.Add(new ParticipantsObject {
                CallQuality = "1_good"
            });

            MetaObject MetaObject = new MetaObject
            {
                Next = "/api/admin/status/v1/participant/?limit=20&offset=20"
            };

            ParticipantsResponse ParticipantsResponse = new ParticipantsResponse
            {
                MetaObject         = MetaObject,
                ParticipantsObject = testParticipantsList
            };

            // Page 2
            List <ParticipantsObject> testParticipantsListTwo = new List <ParticipantsObject>();

            testParticipantsListTwo.Add(new ParticipantsObject {
                CallQuality = "4_terrible"
            });

            MetaObject MetaObjectTwo = new MetaObject
            {
                Next = null
            };

            ParticipantsResponse ParticipantsResponseTwo = new ParticipantsResponse
            {
                MetaObject         = MetaObjectTwo,
                ParticipantsObject = testParticipantsListTwo
            };

            // Serialise the object
            var expectedResponse    = JsonConvert.SerializeObject(ParticipantsResponse);
            var expectedResponseTwo = JsonConvert.SerializeObject(ParticipantsResponseTwo);

            // Set up the mock with the expected response
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(expectedResponse)
            };
            var mockResponseTwo = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(expectedResponseTwo)
            };
            var mockHandler = new Mock <HttpClientHandler>();

            mockHandler
            .Protected()
            .Setup <Task <HttpResponseMessage> >(
                "SendAsync",
                ItExpr.Is <HttpRequestMessage>(message => message.RequestUri == requestUri),
                ItExpr.IsAny <CancellationToken>())
            .Returns(Task.FromResult(mockResponse));

            mockHandler
            .Protected()
            .Setup <Task <HttpResponseMessage> >(
                "SendAsync",
                ItExpr.Is <HttpRequestMessage>(message => message.RequestUri == requestUriTwo),
                ItExpr.IsAny <CancellationToken>())
            .Returns(Task.FromResult(mockResponseTwo));

            // Set up the HttpClient using the mock handler object
            HttpClient client = new HttpClient(mockHandler.Object);

            // Initialise an instance of the Participants class for testing using the HttpClient
            Participants participants = new Participants(client, "https://localhost");

            // Act

            var participantsResult = participants.Get().Result;

            // Assert

            // Assert that a List of participants was returned with 21 items
            Assert.True(participantsResult.Count == 21);
        }
Ejemplo n.º 4
0
    void GameOver(Participants winner)
    {
        UserInterface gui = GetComponent <UserInterface>();

        gui.displayGameOver = true;
    }
Ejemplo n.º 5
0
 public void AddParticipant(int personId)
 {
     Participants.Add(new BillParticipant(this, personId));
 }
Ejemplo n.º 6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    CTFBase b = reader.ReadItem() as CTFBase;
                    HomeBases.Add(b);
                }
                m_Challenger = reader.ReadMobile();

                m_Organizers.Add(m_Challenger);

                m_GameLocked     = reader.ReadBool();
                m_GameInProgress = reader.ReadBool();
                m_TotalPurse     = reader.ReadInt();
                m_EntryFee       = reader.ReadInt();
                m_ArenaSize      = reader.ReadInt();
                m_TargetScore    = reader.ReadInt();
                m_MatchLength    = reader.ReadTimeSpan();

                TimeSpan elapsed = reader.ReadTimeSpan();

                if (elapsed > TimeSpan.Zero)
                {
                    m_MatchStart = DateTime.UtcNow - elapsed;
                }

                m_MatchEnd = reader.ReadDateTime();

                count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    ChallengeEntry entry = new ChallengeEntry();
                    entry.Participant = reader.ReadMobile();
                    string sname = reader.ReadString();
                    // look up the enum by name
                    ChallengeStatus status = ChallengeStatus.None;
                    try{
                        status = (ChallengeStatus)Enum.Parse(typeof(ChallengeStatus), sname);
                    } catch {}
                    entry.Status          = status;
                    entry.Accepted        = reader.ReadBool();
                    entry.PageBeingViewed = reader.ReadInt();
                    entry.Score           = reader.ReadInt();
                    entry.Winner          = reader.ReadBool();
                    entry.Team            = reader.ReadInt();

                    Participants.Add(entry);
                }
                break;
            }

            if (GameCompleted)
            {
                Timer.DelayCall(PostGameDecayTime, new TimerCallback(Delete));
            }

            // start the challenge timer
            StartChallengeTimer();

            SetNameHue();
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Remove a participating user from this event.
 /// </summary>
 public void RemoveParticipant(int user_id, UserSession session = null)
 {
     RemoveParticipant(Id, user_id, session);
     Participants.Remove(Participants.Find(u => u.Id == user_id));
     UpdatedAt = DateTime.Now;
 }
Ejemplo n.º 8
0
 public void OnGet()
 {
     participantsView = Participants.Read(Participants.participantsFile);
 }
Ejemplo n.º 9
0
 public async Task <int> AddParticipants(Participants participant)
 {
     context.Add(participant);
     return(await context.SaveChangesAsync());
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Add a user as a participant if this event.
 /// </summary>
 public void AddParticipant(int user_id, UserSession session = null)
 {
     Participants.Add(AddParticipant(Id, user_id, session));
     UpdatedAt = DateTime.Now;
 }
Ejemplo n.º 11
0
        public void Handle(ParticipantAverageChanged e)
        {
            var participant = Participants.Single(x => x.Id == e.Id);

            participant.Average = e.Average;
        }
Ejemplo n.º 12
0
        public void Handle(ParticipantAssignedToTeam e)
        {
            var participant = Participants.Single(x => x.Id == e.Id);

            participant.Province = Teams[e.TeamId];
        }
Ejemplo n.º 13
0
 private bool IsPartOfParty(Participants partyParticipants)
 {
     if (partyParticipants.Type == ParticipantsType.Chat)
     {
         foreach (var partyParticipant in partyParticipants.ChatParticipants)
         {
             string participantAddress = TelegramUtils.GetUserIdFromParticipant(partyParticipant);
             if (participantAddress == Settings.AccountId.ToString(CultureInfo.InvariantCulture))
             {
                 return true;
             }
         }
     }
     else
     {
         foreach (var partyParticipant in partyParticipants.ChannelParticipants)
         {
             string participantAddress = TelegramUtils.GetUserIdFromChannelParticipant(partyParticipant);
             if (participantAddress == Settings.AccountId.ToString(CultureInfo.InvariantCulture))
             {
                 return true;
             }
         }
     }
     return false;
 }
Ejemplo n.º 14
0
        public void Handle(ParticipantAssignedToRoom e)
        {
            var participant = Participants.Single(x => x.Id == e.Id);

            participant.RoomNumber = e.RoomNumber;
        }
Ejemplo n.º 15
0
 public bool CanRemoveSelectedParticipant(object selected)
 {
     return(selected != null ? Participants.Contains(selected) : false);
 }
Ejemplo n.º 16
0
 private Participants GetPartyParticipants(MessagesChatFull fullChat)
 {
     if (_participants != null)
     {
         return _participants;
     }
     lock (_participantsLock)
     {
         if (_participants != null)
         {
             return _participants;
         }
         var iChatFull = fullChat.FullChat;
         var chatFull = iChatFull as ChatFull;
         var channelFull = iChatFull as ChannelFull;
         if (chatFull != null)
         {
             var chatParticipants = chatFull.Participants as ChatParticipants;
             if (chatParticipants != null)
             {
                 DebugPrint("###### Party participants " + ObjectDumper.Dump(chatParticipants));
                 _participants = new Participants
                 {
                     Type = ParticipantsType.Chat,
                     ChatParticipants = chatParticipants.Participants
                 };
                 return _participants;
             }
         }
         if (channelFull != null)
         {
             var channelParticipants = GetChannelParticipants(channelFull, new ChannelParticipantsRecent());
             DebugPrint("###### Party participants " + ObjectDumper.Dump(channelParticipants));
             _participants = new Participants
             {
                 Type = ParticipantsType.Channel,
                 ChannelParticipants = channelParticipants
             };
             return _participants;
         }
     }
     return null;
 }
Ejemplo n.º 17
0
        private void AddNewParticipant()
        {
            Participant participant = new Participant("Vuns", "Mette", "Quickie-Mart");

            Participants.Add(new ParticipantViewModel(participant));
        }
Ejemplo n.º 18
0
 public void AddParticipant(Person person)
 {
     Participants.Add(new BillParticipant(this, person));
 }
Ejemplo n.º 19
0
 public WSRContext()
 {
     //if (!(Database.GetService<IDatabaseCreator>() as RelationalDatabaseCreator).Exists())
     Database.EnsureDeleted();
     Database.EnsureCreated();
     if (!Participants.Any())
     {
         string DPath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\"));
         DPath += "\\CSV\\";
         Database.OpenConnection();
         using (var reader = new StreamReader(DPath + "Participants.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Participants.AddRange(csv.GetRecords <Participant>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Participants ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Participants OFF;");
         using (var reader = new StreamReader(DPath + "Experts.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Experts.AddRange(csv.GetRecords <Expert>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Experts ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Experts OFF;");
         using (var reader = new StreamReader(DPath + "Admins.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Administrators.AddRange(csv.GetRecords <Administrator>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Administrators ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Administrators OFF;");
         using (var reader = new StreamReader(DPath + "Coordinators.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Coordinators.AddRange(csv.GetRecords <Coordinator>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Coordinators ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Coordinators OFF;");
         List <Competention> temp = new List <Competention>();
         using (var reader = new StreamReader(DPath + "Competentions.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 temp.AddRange(csv.GetRecords <Competention>());
             }
         using (var reader = new StreamReader(DPath + "CompetentionDesc.txt", Encoding.Default))
         {
             Competention CurrC;
             for (int Counter = 1; Counter <= temp.Count; Counter++)//relies on competencies being consequentioal from 1
             {
                 CurrC             = temp.FirstOrDefault(c => c.Id == Counter);
                 CurrC.Description = reader.ReadLine();
             }
         }
         Competentions.AddRange(temp);
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Competentions ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Competentions OFF;");
         using (var reader = new StreamReader(DPath + "Championships.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Championships.AddRange(csv.GetRecords <Championship>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Championships ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Championships OFF;");
         using (var reader = new StreamReader(DPath + "Infrastructures.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Infrastructures.AddRange(csv.GetRecords <Infrastructure>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Infrastructures ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Infrastructures OFF;");
         using (var reader = new StreamReader(DPath + "SMPs.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 SMPs.AddRange(csv.GetRecords <SMP>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.SMPs ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.SMPs OFF;");
         using (var reader = new StreamReader(DPath + "Results.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Results.AddRange(csv.GetRecords <Result>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Results ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Results OFF;");
         using (var reader = new StreamReader(DPath + "Sponsors.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Sponsors.AddRange(csv.GetRecords <Sponsor>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Sponsors ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Sponsors OFF;");
         using (var reader = new StreamReader(DPath + "Volunteers.csv"))
             using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
             {
                 Volunteers.AddRange(csv.GetRecords <Volunteer>());
             }
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Volunteers ON;");
         SaveChanges();
         Database.ExecuteSqlRaw("SET IDENTITY_INSERT dbo.Volunteers OFF;");
         Database.CloseConnection();
     }
 }
Ejemplo n.º 20
0
 public void RemoveParticipant(Predicate <BillParticipant> filterExpression)
 {
     Participants.RemoveAll(filterExpression);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Sorts and Returns the list of participants.
 /// </summary>
 /// <returns>The Participant list.</returns>
 public List <Participant> GetList()
 {
     Participants = Participants.OrderByDescending(x => x.Initiative).ToList();
     return(Participants);
 }
Ejemplo n.º 22
0
        public void TestGettingParticipantMediaStreams()
        {
            // Arrange

            // The URI we are using in the test
            var requestUri = new Uri("https://localhost/api/admin/status/v1/participant/f2e8df3d-cbb4-43bd-be19-e4f5633393d3/media_stream/");

            List <ParticipantMediaStreamObject> streams = new List <ParticipantMediaStreamObject>();

            streams.Add(new ParticipantMediaStreamObject {
                RxJitter     = 55,
                RxPacketLoss = 10,
                TxCodec      = "opus",
                TxPacketLoss = 0.02,
                TxJitter     = 1.49
            });
            streams.Add(new ParticipantMediaStreamObject {
                RxJitter     = 55,
                RxPacketLoss = 10,
                RxCodec      = "opus",
                TxPacketLoss = 0.02,
                TxJitter     = 1.49
            });

            MetaObject MetaObject = new MetaObject
            {
                Next = null
            };

            ParticipantMediaStreamResponse participantsMediaStreamModel = new ParticipantMediaStreamResponse
            {
                MetaObject = MetaObject,
                ParticipantMediaStreamObject = streams
            };

            // Serialise the object
            var expectedResponse = JsonConvert.SerializeObject(participantsMediaStreamModel);

            // Set up the mock with the expected response
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(expectedResponse)
            };
            var mockHandler = new Mock <HttpClientHandler>();

            mockHandler
            .Protected()
            .Setup <Task <HttpResponseMessage> >(
                "SendAsync",
                ItExpr.Is <HttpRequestMessage>(message => message.RequestUri == requestUri),
                ItExpr.IsAny <CancellationToken>())
            .Returns(Task.FromResult(mockResponse));

            // Set up the HttpClient using the mock handler object
            HttpClient client = new HttpClient(mockHandler.Object);

            // Initialise an instance of the Participants class for testing using the HttpClient
            IParticipants participants = new Participants(client, "https://localhost");

            // Act

            var participantMediaStreamResult = participants.GetMediaStreams("f2e8df3d-cbb4-43bd-be19-e4f5633393d3").Result;

            // Assert

            // Assert that a List of participants was returned with 1 item
            Assert.True(participantMediaStreamResult.Count == 2);
        }
 public AppUser GetDialogUser()
 {
     return(Participants?.FirstOrDefault());
 }
Ejemplo n.º 24
0
    public bool SpawnMinion(Participants player, Minion.MINIONTYPE type)
    {
        //Storing the spawned minions game object
        GameObject     go;
        Minion         spawnedMinion;
        SpriteRenderer spawnedSprite;

        if (player == Participants.PLAYER)
        {
            //Gold check
            if (type == Minion.MINIONTYPE.MINIONTYPE_LIGHT)
            {
                if (lightMinionCost > playerGold)
                {
                    return(false);
                }
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_MEDIUM)
            {
                if (mediumMinionCost > playerGold)
                {
                    return(false);
                }
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_HEAVY)
            {
                if (heavyMinionCost > playerGold)
                {
                    return(false);
                }
            }

            go            = Instantiate(minionPrefab, playerSpawn.transform.position, Quaternion.identity) as GameObject;
            spawnedMinion = go.GetComponent <Minion>();
            spawnedSprite = go.GetComponent <SpriteRenderer>();

            if (type == Minion.MINIONTYPE.MINIONTYPE_LIGHT)
            {
                SubtractGold(Participants.PLAYER, lightMinionCost);
                spawnedMinion.SetHP(Minion.lightMinionHP);
                spawnedMinion.SetSpeed(Minion.lightMinionSpeed);
                spawnedMinion.SetTeam(Minion.TEAM.TEAM_PLAYER);
                spawnedMinion.SetMinionType(Minion.MINIONTYPE.MINIONTYPE_LIGHT);
                spawnedMinion.SetDestination(playerSpawn);
                spawnedSprite.sprite = spritePlayerLight;
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_MEDIUM)
            {
                SubtractGold(Participants.PLAYER, mediumMinionCost);
                spawnedMinion.SetHP(Minion.mediumMinionHP);
                spawnedMinion.SetSpeed(Minion.mediumMinionSpeed);
                spawnedMinion.SetTeam(Minion.TEAM.TEAM_PLAYER);
                spawnedMinion.SetMinionType(Minion.MINIONTYPE.MINIONTYPE_MEDIUM);
                spawnedMinion.SetDestination(playerSpawn);
                spawnedSprite.sprite = spritePlayerMedium;
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_HEAVY)
            {
                SubtractGold(Participants.PLAYER, heavyMinionCost);
                spawnedMinion.SetHP(Minion.heavyMinionHP);
                spawnedMinion.SetSpeed(Minion.heavyMinionSpeed);
                spawnedMinion.SetTeam(Minion.TEAM.TEAM_PLAYER);
                spawnedMinion.SetMinionType(Minion.MINIONTYPE.MINIONTYPE_HEAVY);
                spawnedMinion.SetDestination(playerSpawn);
                spawnedSprite.sprite = spritePlayerHeavy;
            }
        }
        else if (player == Participants.ENEMY)
        {
            //Gold check
            if (type == Minion.MINIONTYPE.MINIONTYPE_LIGHT)
            {
                if (lightMinionCost > enemyGold)
                {
                    return(false);
                }
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_MEDIUM)
            {
                if (mediumMinionCost > enemyGold)
                {
                    return(false);
                }
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_HEAVY)
            {
                if (heavyMinionCost > enemyGold)
                {
                    return(false);
                }
            }

            go            = Instantiate(minionPrefab, enemySpawn.transform.position, Quaternion.identity) as GameObject;
            spawnedMinion = go.GetComponent <Minion>();
            spawnedSprite = go.GetComponent <SpriteRenderer>();

            if (type == Minion.MINIONTYPE.MINIONTYPE_LIGHT)
            {
                SubtractGold(Participants.ENEMY, lightMinionCost);
                spawnedMinion.SetHP(Minion.lightMinionHP);
                spawnedMinion.SetSpeed(Minion.lightMinionSpeed);
                spawnedMinion.SetTeam(Minion.TEAM.TEAM_ENEMY);
                spawnedMinion.SetMinionType(Minion.MINIONTYPE.MINIONTYPE_LIGHT);
                spawnedMinion.SetDestination(enemySpawn);
                spawnedSprite.sprite = spriteEnemyLight;
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_MEDIUM)
            {
                SubtractGold(Participants.ENEMY, mediumMinionCost);
                spawnedMinion.SetHP(Minion.mediumMinionHP);
                spawnedMinion.SetSpeed(Minion.mediumMinionSpeed);
                spawnedMinion.SetTeam(Minion.TEAM.TEAM_ENEMY);
                spawnedMinion.SetMinionType(Minion.MINIONTYPE.MINIONTYPE_MEDIUM);
                spawnedMinion.SetDestination(enemySpawn);
                spawnedSprite.sprite = spriteEnemyMedium;
            }
            else if (type == Minion.MINIONTYPE.MINIONTYPE_HEAVY)
            {
                SubtractGold(Participants.ENEMY, heavyMinionCost);
                spawnedMinion.SetHP(Minion.heavyMinionHP);
                spawnedMinion.SetSpeed(Minion.heavyMinionSpeed);
                spawnedMinion.SetTeam(Minion.TEAM.TEAM_ENEMY);
                spawnedMinion.SetMinionType(Minion.MINIONTYPE.MINIONTYPE_HEAVY);
                spawnedMinion.SetDestination(enemySpawn);
                spawnedSprite.sprite = spriteEnemyHeavy;
            }
        }
        return(true);
    }
Ejemplo n.º 25
0
 public bool DoesParticipantExist(string username)
 {
     return(Participants.Any(x => x.Username == username));
 }
Ejemplo n.º 26
0
 /// <summary>
 /// To add participant of the record based on ZCRMEventParticipant class instance.
 /// </summary>
 /// <param name="participant">ZCRMEventParticipant class instance</param>
 public void AddParticipant(ZCRMEventParticipant participant)
 {
     Participants.Add(participant);
 }
Ejemplo n.º 27
0
 public Participant GetJudge()
 {
     return(Participants.SingleOrDefault(x => x.IsJudge()));
 }
Ejemplo n.º 28
0
        //Some very complicated Algorithm
        protected override IPerson Calculate()
        {
            var result = Participants.FirstOrDefault(x => x.Height > 160);

            return(result);
        }
Ejemplo n.º 29
0
 public Participant GetVideoHearingOfficer()
 {
     return(Participants.SingleOrDefault(x => x.IsVideoHearingOfficer()));
 }
Ejemplo n.º 30
0
        public void Handle(ParticipantRenamed e)
        {
            var participant = Participants.Single(x => x.Id == e.Id);

            participant.Name = e.Name;
        }
Ejemplo n.º 31
0
 public List <string> CollectedParticipants()
 {
     return(Participants = Participants.Concat(TempParticipants).Distinct().OrderBy(x => x).ToList());
 }
Ejemplo n.º 32
0
        public void Handle(ParticipantRemovedFromRoom e)
        {
            var participant = Participants.Single(x => x.Id == e.Id);

            participant.RoomNumber = 0;
        }
Ejemplo n.º 33
0
 public Task PartyOptionsClosed()
 {
     return Task.Factory.StartNew(() =>
     {
         lock (_fullChatLock)
         {
             _fullChat = null;
             GC.Collect();
         }
         lock(_participantsLock)
         {
             _participants = null;
             GC.Collect();
         }
     });
 }