コード例 #1
0
        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}");
    }