public void AddFootballPlayer(string firstName,
                                      string lastName,
                                      string imagePath,
                                      PlayerPositionType position,
                                      int height,
                                      int weight,
                                      int shirtNumber,
                                      int countryId,
                                      int teamId,
                                      DateTime birthDate)
        {
            FootballPlayer footballPlayer = new FootballPlayer()
            {
                FirstName     = firstName,
                LastName      = lastName,
                ImagePath     = imagePath,
                Height        = height,
                Weight        = weight,
                ShirtNumber   = shirtNumber,
                Position      = position,
                CountryId     = countryId,
                CurrentTeamId = teamId,
                BirthDate     = birthDate
            };

            using (this.unitOfWork)
            {
                this.footballPlayerRepository.Add(footballPlayer);
                this.unitOfWork.Commit();
            }
        }
예제 #2
0
        public static FieldPosition Create(PlayerPositionType type)
        {
            switch (type)
            {
            case PlayerPositionType.CenterBack:
                return(new CenterBack());

            case PlayerPositionType.LeftBack:
                return(new LeftBack());

            case PlayerPositionType.LeftStriker:
                return(new LeftStriker());

            case PlayerPositionType.Center:
                return(new CenterFoward());

            case PlayerPositionType.RightBack:
                return(new RightBack());

            case PlayerPositionType.RightStriker:
                return(new RightStriker());

            default:
                return(null);
            }
        }
예제 #3
0
 public Player(string firstName, string lastName, int id, int age, int heigth, int weigth, RaceType raceType,
               ReligionType religionType, EyeColorType eyeColorType, FaceShapeType faceShape, HairColorType hairColor, BodyShapeType bodyShape,
               int playerNumber, PlayerPositionType playerPosition, PlayerType playerType, int capability)
     : base(firstName, lastName, id, age, heigth, weigth, raceType, religionType, eyeColorType, faceShape, hairColor, bodyShape)
 {
     this.PlayerNumber   = playerNumber;
     this.PlayerType     = playerType;
     this.PlayerPosition = playerPosition;
     this.Capability     = capability;
 }
예제 #4
0
파일: EnemyScript.cs 프로젝트: zimpzon/GFun
    public Vector3 GetPlayerLatestKnownPosition(PlayerPositionType type)
    {
        if (type == PlayerPositionType.Feet)
        {
            return(playerLatestKnownPosition_);
        }
        else if (type == PlayerPositionType.Center)
        {
            return(playerLatestKnownPosition_ + Vector3.up * 0.5f);
        }
        else if (type == PlayerPositionType.Tile)
        {
            return(map_.GetTileBottomMid(playerLatestKnownPosition_));
        }

        throw new System.ArgumentException($"Unknown position type: {type}");
    }