コード例 #1
0
 protected PirateAiModel(PirateModel.PirateType pirateType, MapModel map, ModelLink modelLink, GameController gameController)
 {
     this.pirateType     = pirateType;
     this.map            = map;
     this.modelLink      = modelLink;
     this.gameController = gameController;
 }
コード例 #2
0
    public void SetSprite(PirateModel.PirateType type)
    {
        switch (type)
        {
        case PirateModel.PirateType.Scout:
            shipView.transform.GetChild(0).GetChild(0).gameObject.SetActive(true);
            shipView.GetComponentInChildren <SpriteRenderer>().sprite = ScoutSprite;
            break;

        case PirateModel.PirateType.Platform:
            shipView.GetComponentInChildren <SpriteRenderer>().sprite = PlatformSprite;
            break;

        case PirateModel.PirateType.Frigate:
            shipView.transform.GetChild(0).GetChild(2).gameObject.SetActive(true);
            shipView.GetComponentInChildren <SpriteRenderer>().sprite = FrigateSprite;
            break;

        case PirateModel.PirateType.Destroyer:
            shipView.transform.GetChild(0).GetChild(3).gameObject.SetActive(true);
            shipView.GetComponentInChildren <SpriteRenderer>().sprite = DestroyerSprite;
            break;

        case PirateModel.PirateType.Dreadnought:
            shipView.transform.GetChild(0).GetChild(4).gameObject.SetActive(true);
            shipView.GetComponentInChildren <SpriteRenderer>().sprite = DreadnoughtSprite;
            break;
        }
    }
コード例 #3
0
    //private MapModel map;

    public PatrolAI(PirateModel.PirateType pirateType, MapModel map, ModelLink modelLink, List <SpaceModel> patrolPoints, GameController gameController) : base(pirateType, map, modelLink, gameController)
    {
        // Oisín Notes: This constructor takes in a list of patrol points, which we can use to set up the patrol

        patrolPath = new List <SpaceModel>();
        // Oisín Notes: Should be using a for loop, but for now assume that the patrol points have three points.

        //var thread = new Thread(() =>
        //{
        // path between point 0 and 1
        patrolPath.AddRange(AStarPathfinding.GetPathToDestination(patrolPoints[0], patrolPoints[1]));
        // path between point 1 and 2
        patrolPath.AddRange(AStarPathfinding.GetPathToDestination(patrolPoints[1], patrolPoints[2]));
        // path between point 2 and 0
        patrolPath.AddRange(AStarPathfinding.GetPathToDestination(patrolPoints[2], patrolPoints[0]));

        // patrolPath should now be one continuous line of spaces. If AStar has bugs, it might break around the edges

        // What space of the path we're on.
        currentSpaceOnPath = 0;
        base.SpawnPirate(patrolPath[0]);
        //});
        //thread.Start();
    }
コード例 #4
0
 public PlatformAi(PirateModel.PirateType pirateType, MapModel map, ModelLink modelLink, SpaceModel location, GameController gameController) : base(pirateType, map, modelLink, gameController)
 {
     this.location = location;
     base.SpawnPirate(location);
 }
コード例 #5
0
 public HunterKillerAI(PirateModel.PirateType pirateType, MapModel map, ModelLink modelLink, PlayerModel player, GameController gameController) : base(pirateType, map, modelLink, gameController)
 {
     this.player = player;
 }