public static MatchParameters Default(PlayerParameters player1, PlayerParameters player2, bool isTournament = false)
 {
     return new MatchParameters
     {
       Player1 = player1,
       Player2 = player2,
       IsTournament = isTournament
     };
 }
 //public bool IsSavedGame { get { return SavedGame != null; } }
 public static GameParameters Default(PlayerParameters player1, PlayerParameters player2)
 {
     return new GameParameters
     {
         Player1 = player1,
         Player2 = player2,
         //SearchParameters = SearchParameters.Default,
         Player1Controller = PlayerType.Human,
         Player2Controller = PlayerType.Machine
     };
 }
Beispiel #3
0
    private void Awake()
    {
        // Setting up references.
        groundCheck      = transform.Find("GroundCheck");
        ceilingCheck     = transform.Find("CeilingCheck");
        forwardCheck     = transform.Find("ForwardCheck");
        animate          = GetComponent <Animator>();
        m_Rigidbody2D    = GetComponent <Rigidbody2D>();
        playerParameters = this.GetComponent <PlayerParameters> ();

        //Setting up values
        modMaxSpeed = MaxSpeed;
    }
Beispiel #4
0
    private void Init()
    {
        stats = PlayerParameters.Instance;

        m_PInput = gameObject.AddComponent <PInput>();
        m_PInput.Init(this);

        m_PMove = gameObject.AddComponent <PMove>();
        m_PMove.Init(this);

        m_PCamera = gameObject.AddComponent <PCamera>();
        m_PCamera.Init(this);

        m_PShoot = gameObject.AddComponent <PShoot>();
        m_PShoot.Init(this);

        m_PUI = gameObject.AddComponent <PUI>();
        m_PUI.Init(this);
    }
Beispiel #5
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag.Equals(PLAYER))
        {
            //Since it's a player, we get the player parameters and movement, then do things there with them
            PlayerParameters playerParams   = other.GetComponent <PlayerParameters> ();
            PlayerMovement   playerMovement = other.GetComponent <PlayerMovement> ();

            //If the player is not in invincible status, then go ahead and do damage and other effects
            if (!playerParams.Invincible)
            {
                Scoring.score -= ScoreReduction;
                playerParams.InflictDamage(InflictDamage, InflictStatusEffects);                 //Inflict damage and any potential status effects
                //Destroy(this.gameObject); //Destroy itself to prevent from being called multiple times

                playerMovement.Damage(1);
                //triggers the kick back from taking damage
            }
        }
    }
Beispiel #6
0
        public async Task <List <Player> > GetPlayers(PlayerParameters playerParams)
        {
            var queryable = _context.Players
                            .Where(p => p.Goals >= playerParams.MinGoals)
                            .Where(p => p.Assists >= playerParams.MinAssists)
                            .OrderByDescending(p => p.Goals).ThenByDescending(p => p.Assists)
                            .AsQueryable();

            // add the option to search by player name
            SearchByName(ref queryable, playerParams.Name);

            // add custom headers to the response to help clients with pagination
            await _httpContextAccessor.HttpContext.AddPaginationParamsToResponse(queryable, playerParams.RecordsPerPage);

            var players = await queryable.Paginate(playerParams)
                          .Include(p => p.TeamName)
                          .ToListAsync();

            return(players);
        }
 public static IQueryable <T> Paginate <T>(this IQueryable <T> queryable, PlayerParameters playerParams)
 {
     return(queryable
            .Skip((playerParams.PageNumber - 1) * playerParams.RecordsPerPage)
            .Take(playerParams.RecordsPerPage));
 }
 public Ritual(float gameTime, PlayerParameters.InteractiveObject usedObject, PlayerParameters.Interaction type)
 {
     this.gameTime = gameTime;
     this.usedObject = usedObject;
     this.type = type;
 }
 public Report(PlayerParameters.PlayerNumber source, PlayerParameters.PlayerNumber target)
 {
     this.source = source;
     this.target = target;
 }
 private void Start()
 {
     playerParameters = GetComponentInParent <PlayerParameters>();
 }