public BusinessGraphicsController(Source source, IPlayerCommand playerProvider)
 {
     _source = source;
     interactive = ((BusinessGraphicsSourceDesign)source).AllowUserInteraction;
     _playerProvider = playerProvider;
     UpdateControlState();
 }
 public AudioMixerPlayerOperativeControl(Device device, IPlayerCommand playerProvider, IEventLogging logging)
     : this()
 {
     _countSwitch = 0;
     InitializeController(new AudioMixerPlayerController(device, playerProvider, this, logging));
     SetControlPlayerTimerEnable(true, 3000);
 }
Пример #3
0
        // Randomizes right, left, jump controls - guarantees at least one key will be different
        public void randomizeControls()
        {
            // while (keyRight == KeyCode.D && keyLeft == KeyCode.A && keyJump == KeyCode.W)
            // {
            //     float rand = Random.value;
            //     if (rand < 0.5f)
            //     {
            //         temp = keyLeft;
            //         keyLeft = keyJump;
            //         keyJump = temp;
            //     }

            //     rand = Random.value;
            //     if (rand < 0.5f)
            //     {
            //         temp = keyRight;
            //         keyRight = keyJump;
            //         keyJump = temp;
            //     }
            // }

            // Shuffles commands and then assigns them.
            FisherYatesShuffle(Commands);
            this.Right = Commands[0];
            this.Left  = Commands[1];
            this.Jump  = Commands[2];
        }
Пример #4
0
 public override System.Windows.Forms.Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerCommand, IPresentationClient client)
 {
     DVDPlayerControl2 control = new DVDPlayerControl2(source, playerCommand, logging, client);
     control.Parent = parent;
     parent.Controls.Add(control);
     control.CreateControl();
     return control;
 }
Пример #5
0
 public override Control CreateControlForDevice(IEventLogging logging, Device device, Control parent, IPlayerCommand playerProvider, IPresentationClient client)
 {
     LightPlayerControl control = new LightPlayerControl(device, playerProvider, logging);
     control.Parent = parent;
     parent.Controls.Add(control);
     control.CreateControl();
     return control;
 }
Пример #6
0
 public override Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerCommand, IPresentationClient client)
 {
     VDCTerminalControl control = new VDCTerminalControl(source, playerCommand, logging, client);
     control.Parent = parent;
     parent.Controls.Add(control);
     control.CreateControl();
     return control;
 }
Пример #7
0
 public LightPlayerControl(Device device, IPlayerCommand playerProvider, IEventLogging logging)
     : this()
 {
     _countSwitch = 0;
     _lightGroups = new Dictionary<string, int>();
     InitializeController(new LightPlayerController(device, playerProvider, this, logging));
     SetControlPlayerTimerEnable(true, 3000);
 }
Пример #8
0
 public override System.Windows.Forms.Control CreateControlForSource(IEventLogging logging, TechnicalServices.Persistence.SystemPersistence.Presentation.Source source, System.Windows.Forms.Control parent, IPlayerCommand playerCommand, IPresentationClient client)
 {
     PlayerController controller = new PlayerController(source, playerCommand);
     VNCPlayerControl control = new VNCPlayerControl(controller);
     control.Parent = parent;
     parent.Controls.Add(control);
     control.CreateControl();
     return control;
 }
 void Start()
 {
     instance              = GameManager.Instance;
     this.Clockwise        = ScriptableObject.CreateInstance <MovePlayerClockwise>();
     this.CounterClockwise = ScriptableObject.CreateInstance <MovePlayerCounterClockwise>();
     this.Shoot            = ScriptableObject.CreateInstance <PlayerShoot>();
     this.Jump             = ScriptableObject.CreateInstance <PlayerJump>();
     Animation             = gameObject.GetComponentInChildren <Animator>();
 }
Пример #10
0
 public override Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerProvider, IPresentationClient client)
 {
     PlayerController controller = new PlayerController(source, playerProvider);
     PlayerControl control = new PlayerControl(controller);
     control.Parent = parent;
     parent.Controls.Add(control);
     control.CreateControl();
     return control;
 }
Пример #11
0
 public PlayerController(Source source, IPlayerCommand playerCommand)
 {
     _source = source;
     _playerProvider = playerCommand;
     PowerPointPresentationSourceDesign pptSource = source as PowerPointPresentationSourceDesign;
     if (pptSource != null)
     {
         NumberOfSlides = pptSource.NumberOfSlides;
     }
 }
Пример #12
0
 public void resetControls()
 {
     // keyShoot = KeyCode.Space;
     // keyRight = KeyCode.D;
     // keyLeft = KeyCode.A;
     // keyJump = KeyCode.W;
     this.Right = ScriptableObject.CreateInstance <MovePlayerRight>();
     this.Left  = ScriptableObject.CreateInstance <MovePlayerLeft>();
     this.Jump  = ScriptableObject.CreateInstance <PlayerJump>();
 }
Пример #13
0
        private void Update()
        {
            HundleInput();
            if (commandQueue.Count == 0)
            {
                return;
            }
            IPlayerCommand command = commandQueue.Dequeue();

            command.Execute(this);
        }
Пример #14
0
 public PlayerController(Source source, IPlayerCommand playerCommand)
 {
     _source = source;
     _playerProvider = playerCommand;
     WordDocumentSourceDesign docSource = source as WordDocumentSourceDesign;
     if (docSource != null)
     {
         NumberOfPages = docSource.NumberOfPages;
         StartZoom = docSource.StartZoom;
     }
 }
Пример #15
0
 internal PlayerController(Source source, IPlayerCommand playerProvider)
 {
     _source = source;
     _playerProvider = playerProvider;
     VideoSourceDesign videoSourceDesign = source as VideoSourceDesign;
     if (videoSourceDesign != null)
     {
         _duration = videoSourceDesign.Duration;
     }
     GetStatus();
 }
Пример #16
0
 public PlayerController(Source source, IPlayerCommand playerCommand)
 {
     _source = source;
     _playerProvider = playerCommand;
     IEDocumentSourceDesign ieSource = source as IEDocumentSourceDesign;
     //if (ieSource != null)
     //{
     //    //NumberOfSlides = ieSource.NumberOfSlides;
     //    ZoomProperty = ieSource.Zoom;
     //}
 }
Пример #17
0
        public VDCTerminalControl(Source source, IPlayerCommand playerCommand, IEventLogging logging, IPresentationClient client)
            : this()
        {
            CollapsedRGBOption = true;
            cbaAbonents.DisplayMember = "Name";
            cbaAbonents.ValueMember = "Number1";

            _controller = new PlayerController(client, source, this, playerCommand, logging);
            InitializeController(_controller);
            SetControlPlayerTimerEnable(true, 1000);
        }
Пример #18
0
 public override Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerProvider, IPresentationClient client)
 {
     ArcGISMapController controller = new ArcGISMapController(source, playerProvider);
     //ChartManageControl control = new ChartManageControl(controller);
     //control.Parent = parent;
     //parent.Controls.Add(control);
     //control.CreateControl();
     MapManageControl control = new MapManageControl(controller);
     control.Parent = parent;
     parent.Controls.Add(control);
     control.CreateControl();
     return control;
 }
Пример #19
0
 // Start is called before the first frame update
 void Start()
 {
     this.healthBar     = GameObject.FindGameObjectWithTag("Manager").GetComponent <HUDManager>();
     this.healthManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <HealthManager>();
     key                   = this.healthManager.Add(Health);
     this.Right            = ScriptableObject.CreateInstance <MovePlayerRightMovement>();
     this.Left             = ScriptableObject.CreateInstance <MovePlayerLeftMovement>();
     this.Jump             = ScriptableObject.CreateInstance <MovePlayerJumpMovement>();
     this.KnockbackRight   = ScriptableObject.CreateInstance <MovePlayerKnockbackRight>();
     this.KnockbackLeft    = ScriptableObject.CreateInstance <MovePlayerKnockbackLeft>();
     this.playerAnimator   = GetComponent <Animator>();
     this.currentState     = State.Grounded;
     this.currentDirection = Direction.Right;
 }
Пример #20
0
 public DVDPlayerControl2(Source source, IPlayerCommand playerCommand, IEventLogging logging, IPresentationClient client)
     : this()
 {
     InitializeController(new PlayerController(client, source, this, playerCommand, logging));
     switch (_DVDType)
     {
         case InterfaceTypeEnum.IR:
             SetControlPlayerTimerEnable(false, 1);
             break;
         case InterfaceTypeEnum.RS232:
             SetControlPlayerTimerEnable(true, 1000);
             break;
     }
 }
Пример #21
0
        // Start is called before the first frame update
        void Start()
        {
            //this.Shoot = this.gameObject.AddComponent<PlayerShootCommand>();
            this.Right = ScriptableObject.CreateInstance <MovePlayerRight>();
            this.Left  = ScriptableObject.CreateInstance <MovePlayerLeft>();
            this.Jump  = ScriptableObject.CreateInstance <PlayerJump>();

            // Array that will hold commands.
            this.Commands = new IPlayerCommand[3];

            this.Commands[0] = this.Right;
            this.Commands[1] = this.Left;
            this.Commands[2] = this.Jump;

            animator = gameObject.GetComponent <PlayerAnimation>();

            resetControls();
        }
Пример #22
0
Файл: Game.cs Проект: Corne/VOC
        public void Execute(IPlayerCommand command)
        {
            if (command == null)
                throw new ArgumentNullException(nameof(command));
            if (currentTurn == null)
                throw new InvalidOperationException("Game not started");

            if (command.Player != currentTurn.Player && command.Type != GameCommand.Trade)
                throw new InvalidOperationException("This player can't execute a command at the moment");
            if (!currentTurn.CanExecute(command.Type))
                throw new ArgumentException("Can't execute this command in current state");

            command.Execute();

            bank.UpdateAchievements(currentTurn.Player);
            if (bank.VerifyWinCondition(currentTurn.Player))
                SetGameFinished();
            else
                currentTurn.AfterExecute(command.Type);
        }
Пример #23
0
 public VDCServerPlayerControl(IEventLogging logging, Device device, IPlayerCommand playerProvider)
     : this()
 {
     InitializeController(new VDCServerPlayerController(device, playerProvider, this, logging));
     SetControlPlayerTimerEnable(true, 1000);
 }
Пример #24
0
 public void EnqueueCommand(IPlayerCommand command)
 {
     commandQueue.Enqueue(command);
 }
Пример #25
0
 void Start()
 {
     this.idle       = ScriptableObject.CreateInstance <PlayerIdle>();
     speedMultiplier = 1;
 }
Пример #26
0
 internal PlayerController(Source source, IPlayerCommand playerProvider)
 {
     _source = source;
     _playerProvider = playerProvider;
     GetStatus();
 }
Пример #27
0
 private void Start()
 {
     commandKeyZ = GenerateCommand(actionKeyZ);
     commandKeyX = GenerateCommand(actionKeyX);
 }
Пример #28
0
 public static void Register()
 {
     Data = new CommandData("/help", "This will display information about the currently registered commands.");
     IPlayerCommand.Create(Data, PlayerCommandInvoked, null);
 }
 public VideoCameraPlayerCommonControl(Source source, IPlayerCommand playerCommand, IEventLogging logging, IPresentationClient client)
     : this()
 {
     InitializeController(new VideoCameraPlayerCommonController(client, source, this, playerCommand, logging));
     SetControlPlayerTimerEnable(true, 1000);
 }
Пример #30
0
 public virtual Control CreateControlForDisplay(IEventLogging logging, Display display, Control parent, IPlayerCommand playerProvider, IPresentationClient client)
 {
     return null;
 }
Пример #31
0
 private static bool CommandTextEqual(IPlayerCommand playerCommand, string inputCommand)
 {
     return(string.Equals(playerCommand.CommandText, inputCommand, StringComparison.InvariantCultureIgnoreCase));
 }
Пример #32
0
 public JupiterPlayerControl(Device device, IPlayerCommand playerProvider, IEventLogging logging)
     : this()
 {
     InitializeController(new JupiterPlayerController(device, playerProvider, this, logging));
     SetControlPlayerTimerEnable(true, 3000);
 }
Пример #33
0
 public virtual Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerProvider, IPresentationClient client)
 {
     return null;
 }
Пример #34
0
 public ArcGISMapController(Source source, IPlayerCommand playerProvider)
 {
     _source = source;
     _playerProvider = playerProvider;
 }