public IT_Control_InteractorMain(HardDriveGateway iHD, ScreenBoundary iScreen, PointDataGateway iPointData, OutputBoundary iOut)
 {
     interactor = new ITControl_Interactor(
         iOut,
         iPointData,
         iHD,
         iScreen
         );
 }
Exemple #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param></param>
        ///

        //viết trước khi có history
        public PointInteractor(
            PointDataGateway iPointDataGateway,
            OutputBoundary iOutput,
            ScreenBoundary iScreen)
        {
            _IPointDataGateway = iPointDataGateway;
            _Ioutput           = iOutput;
            _IScreen           = iScreen;
        }
 public PointInteractorMain(HistoryGateway iHistory, ScreenBoundary iScreen, PointDataGateway iPointData, OutputBoundary iOut)
 {
     interactor = new PointInteractor(
         iHistory,
         iPointData,
         iOut,
         iScreen
         );
 }
Exemple #4
0
 public ITControl_Interactor(OutputBoundary iOutput,
                             PointDataGateway iPoint,
                             HardDriveGateway hd,
                             ScreenBoundary iScreen)
 {
     _iOuput  = iOutput;
     _iPoint  = iPoint;
     _hd      = hd;
     _iScreen = iScreen;
 }
 public ITControl_Interactor(OutputBoundary iOutput,
                             PointDataGateway iPoint,
                             HardDriveGateway hd,
                             ScreenBoundary iScreen,
                             FileOpenerAPI fileAPI)
 {
     _iOuput  = iOutput;
     _iPoint  = iPoint;
     _hd      = hd;
     _iScreen = iScreen;
     _fileAPI = fileAPI;
 }
Exemple #6
0
 public void Construct(
     Laser laser,
     Pool laserPool,
     ScreenBoundary screenBoundary,
     LaserHitHandler laserHitHandler
     )
 {
     this.laser           = laser;
     this.laserPool       = laserPool;
     this.screenBoundary  = screenBoundary;
     this.laserHitHandler = laserHitHandler;
 }
Exemple #7
0
 public AsteroidMoveHandler(
     IAsteroid asteroid,
     AsteroidFacade asteroidFacade,
     AsteroidFacade.Pool asteroidFactory,
     ScreenBoundary screenBoundary
     )
 {
     this.asteroid        = asteroid;
     this.asteroidFacade  = asteroidFacade;
     this.asteroidFactory = asteroidFactory;
     this.screenBoundary  = screenBoundary;
 }
Exemple #8
0
 public ShipMoveHandler(
     Camera camera,
     Ship ship,
     ScreenBoundary screenBoundary,
     StartShootingSignal startShootingSignal
     )
 {
     this.camera              = camera;
     this.ship                = ship;
     this.screenBoundary      = screenBoundary;
     this.startShootingSignal = startShootingSignal;
 }
 public EnemyMoveHandler(
     Enemy enemy,
     EnemyFacade enemyFacade,
     EnemyFacade.Pool enemyFactory,
     ScreenBoundary screenBoundary
     )
 {
     this.enemy          = enemy;
     this.enemyFacade    = enemyFacade;
     this.enemyFactory   = enemyFactory;
     this.screenBoundary = screenBoundary;
 }
Exemple #10
0
 public EnemySpawner(
     Settings settings,
     EnemyCommonSettings enemyCommonSettings,
     ScreenBoundary screenBoundary,
     EnemyFacade.Pool enemyFactory
     )
 {
     this.settings            = settings;
     this.enemyCommonSettings = enemyCommonSettings;
     this.screenBoundary      = screenBoundary;
     this.enemyFactory        = enemyFactory;
 }
Exemple #11
0
    public AsteroidSpawner(
        Settings settings,
        AsteroidCommonSettings asteroidCommonSettings,
        ScreenBoundary screenBoundary,
        AsteroidFacade.Pool asteroidFactory

        )
    {
        this.settings = settings;
        this.asteroidCommonSettings = asteroidCommonSettings;
        this.screenBoundary         = screenBoundary;
        this.asteroidFactory        = asteroidFactory;
    }
Exemple #12
0
 public EnemyLaserHandler(
     Enemy enemy,
     Settings settings,
     LaserFacade.Pool laserPool,
     ScreenBoundary screenBoundary,
     EnemyCommonSettings enemyCommonSettings
     )
 {
     this.enemy               = enemy;
     this.settings            = settings;
     this.laserPool           = laserPool;
     this.screenBoundary      = screenBoundary;
     this.enemyCommonSettings = enemyCommonSettings;
 }
Exemple #13
0
    public void PostConstruct()
    {
        Vector3 bottomCenter = screenUtil.BottomCenter;
        Vector3 bottomOffset = new Vector3(0f, -1f, 0f);

        Boundary = new ScreenBoundary(
            -screenUtil.maxBound.x + 0.5f,
            -screenUtil.maxBound.y + 0.5f,
            screenUtil.maxBound.x - 0.5f,
            screenUtil.maxBound.y - 0.5f
            );
        SpawnPosition = bottomCenter - bottomOffset;
        SpawnRotation = Quaternion.identity;
        FireRate      = 0.5f;
        Speed         = 6;
    }
Exemple #14
0
    void Awake()
    {
        collisionSoundEffect         = GetComponent <AudioSource>();
        collisionSoundEffect.enabled = true;
        powerUp     = -1;
        hasLaunched = false;
        rigidBody   = GetComponent <Rigidbody>();
        SphereCollider sphereCollider    = GetComponent <SphereCollider>();
        Vector3        worldRadiusVector = sphereCollider.transform.TransformPoint(new Vector3(sphereCollider.radius, 0.0f, 0.0f));

        worldRadius           = worldRadiusVector.x;
        worldScreenBoundary   = ScreenBoundary.GetBoundary();
        trailRenderer         = GetComponentInChildren <TrailRenderer>();
        trailRenderer.enabled = false;

        //Move the ball up by its radius to ensure the ball is centered over
        //the paddle
        this.transform.position = new Vector3(this.transform.position.x,
                                              this.transform.position.y + sphereCollider.radius,
                                              this.transform.position.z);
    }
Exemple #15
0
    private static void GenerateBricksInLevel(ref StringReader stringReader, ref List <GameObject> bricks)
    {
        GameObject brickPrefab     = Resources.Load("Prefabs/Brick") as GameObject;
        GameObject goldenBarPrefab = Resources.Load("Prefabs/GoldenBar") as GameObject;

        Boundary screenBoundary = ScreenBoundary.GetBoundary();
        Vector3  brickSize      = new Vector3(screenBoundary.width / MAX_NUMBER_OF_COLUMNS,
                                              (screenBoundary.height / (MAX_NUMBER_OF_ROWS * (MAX_NUMBER_OF_COLUMNS / MAX_NUMBER_OF_ROWS))),
                                              brickPrefab.transform.localScale.z);

        brickPrefab.transform.localScale     = brickSize;
        goldenBarPrefab.transform.localScale = brickSize;

        string  line;
        Vector3 brickPosition = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, Screen.height, 0.0f));
        int     rows          = 0;
        int     columns       = 0;

        while ((line = stringReader.ReadLine()) != null)
        {
            if (rows < MAX_NUMBER_OF_ROWS)
            {
                char[] textFileContentArray = line.ToCharArray();
                bool   firstBrick           = true;
                //Use that content to create the breakout level
                foreach (char character in textFileContentArray)
                {
                    //Calculate the brick position regardless
                    //of whether there is a character representing a brick
                    if (columns < MAX_NUMBER_OF_COLUMNS)
                    {
                        if (firstBrick)
                        {
                            brickPosition.x += brickSize.x / 2;
                            if (rows == 0)
                            {
                                brickPosition.y = screenBoundary.top - (brickSize.y / 2);
                            }
                            else
                            {
                                brickPosition.y = screenBoundary.top - (brickSize.y * (((float)rows + 1.0f) - 0.5f));
                            }
                            firstBrick = false;
                        }
                        else
                        {
                            brickPosition.x += brickSize.x;
                        }
                        brickPosition.z = Camera.main.nearClipPlane;
                        columns++;
                        switch (character)
                        {
                        case 'B':
                        {
                            GameObject brick = Instantiate(brickPrefab, brickPosition, Quaternion.identity) as GameObject;
                            bricks.Add(brick);
                            break;
                        }

                        case 'G':
                        {
                            GameObject brick = Instantiate(goldenBarPrefab, brickPosition, Quaternion.identity) as GameObject;
                            bricks.Add(brick);
                            break;
                        }

                        default:
                        {
                            break;
                        }
                        }
                    }
                    else
                    {
                        break;
                    }
                }

                rows++;
                columns = 0;
                //Reset the x position of the brick position to the left side of the screen
                brickPosition.x = screenBoundary.left;
            }
            else
            {
                break;
            }
        }
    }