예제 #1
0
파일: Player.cs 프로젝트: ho-dragon/tps
 public void Init(bool isLocalPlayer, TeamCode teamCode, int number, string nickName, float currentHP, float maxHP, bool isDead, int killCount, int deadCount, System.Action <int, Vector3, float> moveCallback)
 {
     Logger.Debug("[Player] Init number = " + number + " / name = " + nickName);
     this.isLocalPlayer = isLocalPlayer;
     this.teamCode      = teamCode;
     this.number        = number;
     this.nickName      = nickName;
     this.isDead        = isDead;
     this.killCount     = killCount;
     this.deadCount     = deadCount;
     if (this.isLocalPlayer)
     {
         this.headerUI.gameObject.SetActive(false);
         UIManager.inst.hud.SetName(nickName);
     }
     else
     {
         this.headerUI.SetCamera(CameraController.inst.playerCamera.GetCamera());
         this.headerUI.gameObject.SetActive(true);
         this.headerUI.SetNickName(nickName);
         this.headerUI.SetTeamCode(teamCode);
     }
     UpdateHP(currentHP, maxHP);
     AttachWeapon(number, "Rifle");//최초 라이플을 들고있도록
     this.actionController.Init(this.animationController, this.transform, number, isLocalPlayer, isDead, moveCallback);
     this.actionController.SetLocalPlayer(isLocalPlayer);
 }
예제 #2
0
 public void SetTeamCode(TeamCode teamCode)
 {
     if (teamCode == TeamCode.NONE)
     {
         return;
     }
     this.teamCode.text  = string.Format("-----{0}-----", teamCode.GetTeamName());
     this.teamCode.color = teamCode.GetColor();
 }
예제 #3
0
파일: TeamCode.cs 프로젝트: ho-dragon/tps
    public static Color GetColor(this TeamCode teamType)
    {
        switch (teamType)
        {
        case TeamCode.RED:
            return(Color.red);

        case TeamCode.BLUE:
            return(Color.blue);
        }
        return(Color.white);
    }
예제 #4
0
    public Vector3 GetRespawnZone(TeamCode teamCode)
    {
        switch (teamCode)
        {
        case TeamCode.BLUE:
            return(GetBlueZone());

        case TeamCode.RED:
            return(GetRedZone());
        }
        return(GetWaitingZone());
    }
예제 #5
0
        public async Task <Team> GetTeam(string teamCode)
        {
            var code = new TeamCode(teamCode);
            var team = await this.teamRepository.FindByCodeAsync(code);

            if (team == null)
            {
                throw new NotFoundException(teamCode, typeof(Team));
            }

            return(team);
        }
예제 #6
0
파일: TeamCode.cs 프로젝트: ho-dragon/tps
    public static string GetTeamName(this TeamCode teamType)
    {
        switch (teamType)
        {
        case TeamCode.RED:
            return("Red");

        case TeamCode.BLUE:
            return("Blue");
        }
        return("");
    }
예제 #7
0
파일: Player.cs 프로젝트: ho-dragon/tps
    public void AssignTeamCode(bool isLocalPlayer, TeamCode teamCode)
    {
        this.teamCode = teamCode;
        if (this.weapon != null)
        {
            this.weapon.SetTeamCode(teamCode);
        }

        if (isLocalPlayer == false)
        {
            this.headerUI.SetTeamCode(teamCode);
        }
    }
예제 #8
0
        public async Task <Team> UpdateTeam(UpdateTeamDto dto)
        {
            var domainTeamCode = new TeamCode(dto.TeamCode);
            var team           = await this.teamRepository.FindByCodeAsync(domainTeamCode);

            if (team == null)
            {
                throw new NotFoundException(dto.TeamCode, typeof(Team));
            }
            team.ChangeTeamData(dto);

            return(await this.teamRepository.Update(team));
        }
예제 #9
0
        public async Task <Team> UpdateTeamJpin(string teamCode, string teamJpin)
        {
            var domainTeamCode = new TeamCode(teamCode);
            var team           = await this.teamRepository.FindByCodeAsync(domainTeamCode);

            if (team == null)
            {
                throw new NotFoundException(teamCode, typeof(Team));
            }

            team.ChangeTeamJpin(teamJpin);
            var changed = await this.teamRepository.Update(team);

            return(changed);
        }
예제 #10
0
        public async Task <string> UpdateTeamMailAddress(string teamCode, string mailAddress)
        {
            var domainTeamCode = new TeamCode(teamCode);
            var team           = await this.teamRepository.FindByCodeAsync(domainTeamCode);

            if (team == null)
            {
                throw new NotFoundException(teamCode, typeof(Team));
            }
            var originalMailAddress = team.RepresentativeEmailAddress;

            team.ChangeRepresentativeEmailAddress(mailAddress);
            await this.teamRepository.Update(team);

            return(originalMailAddress);
        }
예제 #11
0
 /// <summary>
 /// エントリー詳細の新しいインスタンスを生成します。
 /// </summary>
 /// <param name="teamCode">団体登録番号。</param>
 /// <param name="teamName">団体名。</param>
 /// <param name="teamAbbreviatedName">団体名略称。</param>
 /// <param name="playerCode">登録番号。</param>
 /// <param name="playerFamilyName">姓。</param>
 /// <param name="playerFirstName">名。</param>
 /// <param name="point">ポイント。</param>
 public EntryPlayer(
     TeamCode teamCode,
     TeamName teamName,
     TeamAbbreviatedName teamAbbreviatedName,
     PlayerCode playerCode,
     PlayerFamilyName playerFamilyName,
     PlayerFirstName playerFirstName,
     Point point)
 {
     this.TeamCode            = teamCode;
     this.TeamName            = teamName;
     this.TeamAbbreviatedName = teamAbbreviatedName;
     this.PlayerCode          = playerCode;
     this.PlayerFamilyName    = playerFamilyName;
     this.PlayerFirstName     = playerFirstName;
     this.Point = point;
 }
예제 #12
0
    public int GetPlayerCount(TeamCode teamCode)
    {
        int count = 0;

        if (this.localPlayer.IsSameTeam(teamCode))
        {
            count++;
        }
        this.remotePlayers.ForEach(x => {
            if (x.IsSameTeam(teamCode))
            {
                count++;
            }
            ;
        });
        return(count);
    }
예제 #13
0
파일: Player.cs 프로젝트: ho-dragon/tps
 public bool IsSameTeam(TeamCode teamCode)
 {
     return(this.teamCode == teamCode);
 }
예제 #14
0
 public Color getTeamColor(TeamCode teamCode)
 {
     return(TeamColor[(int)teamCode]);
 }
예제 #15
0
 public override void _Ready()
 {
     base._Ready();
     CurrentTeamCode = TeamCode.NEUTRAL;
 }
예제 #16
0
파일: PlayerHUD.cs 프로젝트: ho-dragon/tps
 public void SetMyTeamCode(TeamCode teamCode)
 {
     this.myTeamCode.text  = teamCode.GetTeamName();
     this.myTeamCode.color = teamCode.GetColor();
 }
예제 #17
0
파일: Weapon.cs 프로젝트: ho-dragon/tps
 public void SetTeamCode(TeamCode teamCode)
 {
     this.ownerTeamCode = teamCode;
 }
예제 #18
0
파일: Weapon.cs 프로젝트: ho-dragon/tps
 public void Init(int ownerPlayerNumber, TeamCode teamCode)
 {
     Logger.Debug("[Weapon] Init : ownerPlayerNumber = " + ownerPlayerNumber);
     this.ownerPlayerNumber = ownerPlayerNumber;
     this.ownerTeamCode     = teamCode;
 }