Ejemplo n.º 1
0
    public override void Connect(GameController controller)
    {
        _gameModel = new GameModel();

        _playerController.Connect(_camera, controller.GlobalParams);

        _guestsManager.Connect(_gameModel, controller.GlobalParams.GuestList, controller.Pool, controller.GlobalParams,
                               controller.GlobalParams.CommonAssets,
                               _camera, _bubbleContainer, _minigameContainer, _playerController);

        _cycleManager = new CycleManager(controller, controller.Pool, _guestsManager, _bubbleContainer,
                                         _minigameContainer,
                                         controller.GlobalParams.StorylineCsv, _playerController, _camera, _gameModel);

        _pauseDialog.Connect(controller, TogglePause);
        _pauseDialog.gameObject.SetActive(false);

        _report.Connect(controller);
        _report.gameObject.SetActive(false);

        _tutorial.Connect(_cycleManager);
        OpenTutorialScreen();

        _clockView.Connect(_cycleManager.Timer);
        _collectedMoneyWidget.Connect(_gameModel);

        _cycleManager.Timer.OnTimerElapsed += ShowReport;

        EventManager.OnCallPolice += ContinueGame;
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        cyclemanager = CycleManager.Instance;
        scale        = gameObject.transform.localScale;
        count        = new int[4];
        for (int i = 0; i < 4; i++)
        {
            count[i] = 0;
        }
        transferredCounts = new int[4];
        bool flag = true;

        transferredCounts[0] = cyclemanager.FirstDigit;
        transferredCounts[1] = cyclemanager.SecondDigit;
        transferredCounts[2] = cyclemanager.ThirdDigit;
        transferredCounts[3] = cyclemanager.FourthDigit;

        //If the score is initially 0000, the player has to catch exactly 9 fruits of each type
        foreach (int i in transferredCounts)
        {
            if (i != 0)
            {
                flag = false;
            }
        }

        if (flag == true)
        {
            for (int i = 0; i < 4; i++)
            {
                transferredCounts[i] = 9;
            }
        }
        cyclemanager.FirstDigit  = 9;
        cyclemanager.SecondDigit = 9;
        cyclemanager.ThirdDigit  = 9;
        cyclemanager.FourthDigit = 9;


        for (int i = 0; i < 4; i++)
        {
            countLabels [i].text = "0";
            TargetLabels[i].text = transferredCounts[i].ToString();
        }
        GameObject catchSndObj = GameObject.Find("catchsnd");

        catchSnd = catchSndObj.GetComponent <AudioSource>();
    }
Ejemplo n.º 3
0
        public Game(IEnumerable<User> players, IGameMode mode, BroadcastHandler broadcastHandler, Action onFinish)
        {
            _mode = mode;
            _gameConfiguration = _mode.GetConfiguration();
            _broadcastHandler = broadcastHandler;
            _map = new Map(_gameConfiguration.MapConfig);

            var cycleDictionary = createCycles(players);

            _onFinish = onFinish;
            _cycleManager = new CycleManager(cycleDictionary);

            _map.RegisterCycles(cycleDictionary);
            _broadcastHandler.RegisterCycles(cycleDictionary);

            CommandHandler = new CommandHandler(cycleDictionary);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("FizzBuzz - project");

            Console.WriteLine("Insert first number");

            int currentValue = int.Parse(Console.ReadLine());

            Console.WriteLine("Insert second number");
            int limit = int.Parse(Console.ReadLine());

            CycleManager maneger = new CycleManager();

            currentValue = maneger.GetEvenCount(limit);


            Console.ReadLine();
        }
Ejemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();
            machineControl.EventStart   += new EventStartHandler(machineControleEventStart);
            machineControl.EventExecute += new EventExecuteHandler(machineControlEventExecute);
            machineControl.EventStop    += new EventStopHandler(machineControleEventStop);

            ////Configure Notification Manager
            mNotificationManager = new NotificationManager();

            ////Detector Service
            this.mDetectorMonitor = this.ct3dControl.detectorControl;
            this.mDetectorMonitor.configureConn(1234, "127.0.0.1", 4321, "127.0.0.1");
            this.mDetectorMonitor.startService();

            ////XRay Service
            this.mXRayMonitor = this.ct3dControl.xRayControl;
            this.mXRayMonitor.configurePath(PathTool.bingPathFromAppDir("conf_deployment"), PathTool.bingPathFromAppDir("logs"));
            //this.mXRayMonitor.configurePath(PathTool.bingPathFromAppDir("conf"), PathTool.bingPathFromAppDir("logs"));
            this.mXRayMonitor.startService();

            ////Motion Service
            this.mMotionMonitor = this.ct3dControl.motionControl;
            this.mMotionMonitor.configurePort("COM5", 9600);
            this.mMotionMonitor.startService();

            ////Turnable Monitor
            this.mTurnableMonitor = this.ct3dControl.turntableControl;
            this.mMotionMonitor.RotCPositionChanged += this.mTurnableMonitor.setCurrentRotC;

            ////Create CycleManager
            mCycleManager = new CycleManager(this.mXRayMonitor, this.mMotionMonitor, this.mTurnableMonitor, this.mDetectorMonitor, this.mNotificationManager);
            mCycleManager.EventCycleInfo    += new EventCycleInfoHandler(notifyInfo);
            mCycleManager.EventCycleWarning += new EventCycleWarningHandler(notifyWarning);
            mCycleManager.EventCycleError   += new EventCycleErrorHandler(notifyError);

            Logger.Info("=====>XRay Config = conf_deployment");
            Logger.Info("=====>Motor Config = COM5");
        }
Ejemplo n.º 6
0
 private void Start()
 {
     soundManager      = gameObject.GetComponent <SoundManager>();
     _enclosureManager = EnclosureManager.Instance;
     cycleManager      = CycleManagerObject.GetComponent <CycleManager>();
     cycleManager.SubscribCycle(this);
     cycleManager.GoToAngle(1, 30);
     TotalSheeps    = GameVariables.Initialisation.numberSheeps;
     Time.timeScale = 1;
     GetComponent <DifficultyManager>().SetDiffilculty();
     Cursor.visible   = false;
     Cursor.lockState = CursorLockMode.Locked;
     if (SProfilePlayer.getInstance().AchievementsManager.GetAchievementByName("Player").IsComplete())
     {
         TotalSuperSheeps = 1;
     }
     else
     {
         TotalSuperSheeps = 0;
     }
     DayStart();
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Checks if an existing item at the focus or above that can be cycled through.
        /// Such items are features and bodies.
        /// </summary>
        /// <param name="state">State that can be replaced the item upon return.</param>
        /// <param name="cyclePosition">Position of the current node in the cycle upon return.</param>
        /// <returns>True if an item can be cycled through at the focus.</returns>
        public virtual bool IsItemCyclableThrough(out IFocusCyclableNodeState state, out int cyclePosition)
        {
            state         = null;
            cyclePosition = -1;

            bool IsCyclableThrough = false;

            IFocusNodeState CurrentState = Focus.CellView.StateView.State;

            // Search recursively for a collection parent.
            while (CurrentState != null)
            {
                if (CurrentState is IFocusCyclableNodeState AsCyclableNodeState)
                {
                    if (Controller.IsMemberOfCycle(AsCyclableNodeState, out IFocusCycleManager CycleManager))
                    {
                        CycleManager.AddNodeToCycle(AsCyclableNodeState);

                        FocusInsertionChildNodeIndexList CycleIndexList = AsCyclableNodeState.CycleIndexList;
                        Debug.Assert(CycleIndexList.Count >= 2);
                        int CurrentPosition = AsCyclableNodeState.CycleCurrentPosition;
                        Debug.Assert(CurrentPosition >= 0 && CurrentPosition < CycleIndexList.Count);

                        state         = AsCyclableNodeState;
                        cyclePosition = CurrentPosition;

                        IsCyclableThrough = true;
                        break;
                    }
                }

                CurrentState = CurrentState.ParentState;
            }

            return(IsCyclableThrough);
        }
Ejemplo n.º 8
0
 public void Connect(CycleManager cycleManager)
 {
     _cycleManager = cycleManager;
 }