Example #1
0
 public Player(IPlayerController playerController, Wallet wallet)
 {
     this.playerController = playerController;
     Cards = new List<StandartCard>();
     this.wallet = wallet;
     Active = true;
 }
		/// <summary>
		/// Inicjalizuje obiekt.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="nation"></param>
		/// <param name="controller"></param>
		/// <param name="showStatistics"></param>
		public PlayerInfo(string name, Interfaces.Units.INation nation, IPlayerController controller, bool showStatistics)
		{
			this.Name = name;
			this.Nation = nation;
			this.Controller = controller;
			this.ShowStatistics = showStatistics;
		}
 public PlaylistViewModel(IPlayerController player, IEventAggregator eventAggregator)
 {
     Player = player;
     _eventAggregator = eventAggregator;
     MoveItemCommand = new AutomaticCommand<Tuple<int, int>>(ExecuteMoveItem, CanExecuteMoveItem);
     RemoveItemCommand = new AutomaticCommand<IPlaylistTrack>(ExecuteRemoveItem, CanExecuteRemoveItem);
     RemoveItemsCommand = new AutomaticCommand<IEnumerable<IPlaylistTrack>>(ExecuteRemoveItems,
                                                                            CanExecuteRemoveItems);
 }
    public TinyBombsPlayerControllerModifier(IPlayerController playerController)
    {
        _startTime = Time.time;
        _playerController = playerController;
        _temp = new BombParams();

        _temp.delayTime = _playerController.bombParams.delayTime;
        _temp.explodingDuration = _playerController.bombParams.explodingDuration;
        _temp.radius = 1;
        _temp.warningTime = _playerController.bombParams.warningTime;
    }
 public EcoStatController(GameState game, IPlayerController controller, Economy economy, EcoValue value,
     IAction decreaseInvestment, IAction increaseInvestment, string controlString)
 {
     this.game = game;
     this.controller = controller;
     this.economy = economy;
     this.value = value;
     this.decreaseInvestment = decreaseInvestment;
     this.increaseInvestment = increaseInvestment;
     this.controlString = controlString;
 }
        /// <summary>
        /// Bind a controller to a player.
        /// This method should be called by the composing app.
        /// </summary>
        public void AddBinding(IPlayer PlayerToControl, IPlayerController Controller)
        {
            PlayerToControl.AddController(Controller);

            if (PlayerList == null)
                PlayerList = new List<IPlayer>();

            if (!PlayerList.Contains(PlayerToControl)) {
                var new_list = new List<IPlayer>(PlayerList){PlayerToControl};
                PlayerList = new_list;
            }
        }
Example #7
0
 public void SetUp()
 {
     stubPlayerController = MockRepository.GenerateStub<IPlayerController>();
     playerList = new PlayerList();
     playerList.Add(MockRepository.GenerateStub<IPlayer>());
     playerList.Players[0].Stub(me => me.Weapons).Return(MockRepository.GenerateStub<IWeapons>());
     playerList.Add(MockRepository.GenerateStub<IPlayer>());
     playerList.Players[1].Stub(me => me.Weapons).Return(MockRepository.GenerateStub<IWeapons>());
     weaponViews = new List<IWeaponView>();
     weaponViews.Add(MockRepository.GenerateStub<IWeaponView>());
     weaponViews.Add(MockRepository.GenerateStub<IWeaponView>());
     view = new WeaponDrawer(stubPlayerController, playerList, weaponViews);
 }
        /// <summary>
        /// Unbind this controller from a player.
        /// This method should be called by the composing app.
        /// </summary>
        public void RemoveBinding(IPlayer PlayerToControl, IPlayerController Controller)
        {
            PlayerToControl.RemoveController(Controller);

            if (PlayerList == null)
                PlayerList = new List<IPlayer>();

            if (PlayerList.Contains(PlayerToControl)) {
                var new_list = new List<IPlayer>(PlayerList);
                new_list.Remove(PlayerToControl);
                PlayerList = new_list;
            }
        }
        public PlayQueueViewModel(
            IPlayerController player,
            IEventAggregator eventAggregator,
            IRegionManager regionManager)
        {
            _player = player;
            _playQueue = player.Playlist;

            _eventAggregator = eventAggregator;
            _regionManager = regionManager;

            JumpToTrackCommand = new StaticCommand<PlayerQueueItem>(ExecuteJumpToTrack);
            DeleteTracksCommand = new StaticCommand<IEnumerable>(ExecuteDeleteTracks);
        }
        public NowPlayingViewModel(
            IPlayerController player,
            IEventAggregator eventAggregator)
        {
            _player = player;
            _eventAggregator = eventAggregator;

            _backgroundEffects = new List<IBackgroundEffect>();
            //_backgroundEffects.Add(ServiceLocator.Current.TryResolve<KenBurnsBackgroundEffect>());
            _backgroundEffects.Add(ServiceLocator.Current.TryResolve<ImageMapBackgroundEffect>());
            _backgroundEffects.Add(ServiceLocator.Current.TryResolve<ColorOverlayBackgroundEffect>());

            NavigateBackCommand = new StaticCommand(ExecuteNavigateBack);
            JumpToTrackCommand = new StaticCommand<PlayerQueueItem>(ExecuteJumpToTrack);
        }
Example #11
0
 internal Singles(Room.IUserController c)
 {
     controller = c.PlayerController;
       controller.AddEventsListener(this);
       board = c.Game.Board;
       teamPms = c.Game.Teams[controller.Player.TeamId];
       rivalPms = c.Game.Teams[1 - controller.Player.TeamId];
       selectedPanel = (int)ControlPanelIndex.INACTIVE;
       //controller.Board.MyTeam.PokemonOnBoardChanged += (sender, e) =>
       //  {
       //    if (e.NewPokemon != null) pokemonsInBall.Remove(e.NewPokemon);
       //    if (e.OldPokemon != null) pokemonsInBall.Add(e.OldPokemon);
       //  };
       //pokemonsInBall = new List<IPokemon>(controller.Player.Pokemons.Where(p => p.PositionOnBoard == null));//如果中途加载的话有可能存在正在战斗的精灵
       //this.controller_IsActiveChanged(null, null);
 }
    public DefaultPlayerControllerModifier()
    {
        _playerController = new PlayerController();

        _playerController.speedScalar = 1.0f;
        _playerController.bombKick = 0;
        _playerController.bombLine = 0;
        // Set to zero because changing max number will increase it
        _playerController.currNumBombs = 0;
        _playerController.maxNumBombs = 1;
        _playerController.bombParams = new BombParams();
        _playerController.bombParams.radius = 2;
        _playerController.canLayBombs = true;
        _playerController.alwaysLayBombs = false;
        _playerController.reverseMovement = false;
        _playerController.isRadioactive = false;
    }
 public PlayerViewModel(IPlayerController player)
 {
     _player = player;
 }
Example #14
0
        void HandleOpenedProjectChanged(OpenedProjectEvent e)
        {
            var player = e.AnalysisWindow?.Player;
            if (player == null && Player == null) {
                return;
            } else if (player != null) {
                Player = player;
            }

            OpenedProject = e.Project;
            OpenedProjectType = e.ProjectType;
            Player.LoadedPlaylist = null;
        }
 public AlwaysLayBombsPlayerControllerModifier(IPlayerController playerController)
 {
     _startTime = Time.time;
     _playerController = playerController;
 }
Example #16
0
 internal void Init(IPlayerController pc)
 {
 }
Example #17
0
 /// <summary>
 /// Remove a controller from the list of those to be notified of events.
 /// </summary>
 /// <remarks>A controller doesn't have to be in the list to send commands.</remarks>
 public void RemoveController(IPlayerController Controller)
 {
     if (!ControlSets.Contains(Controller)) return; // nothing to remove
     var new_set = new List<IPlayerController>(ControlSets);
     new_set.Remove(Controller);
     ControlSets = new_set;
 }
Example #18
0
        /// <summary>
        /// Set the playlistManager with a presentation (<see cref="Playlist"/> not attached to a <see cref="Project"/>)
        /// If player is null, the last one will be used (if there is one).
        /// </summary>
        /// <param name="presentation">Presentation.</param>
        /// <param name="player">Player.</param>
        void HandleOpenedPresentationChanged(OpenedPresentationChangedEvent e)
        {
            if (e.Player == null && Player == null) {
                return;
            } else if (e.Player != null) {
                Player = e.Player;
            }

            OpenedProject = null;
            Player.Switch (null, e.Presentation, null);

            OpenedProjectType = ProjectType.None;
            Filter = null;
        }
Example #19
0
 private PlayerController GetControllerMock(IPlayerController playerController)
 {
     var motor = Substitute.For<PlayerController>();
     motor.SetPlayerController(playerController);
     return motor;
 }
Example #20
0
        void HandleOpenedProjectChanged(Project project, ProjectType projectType,
		                                 EventsFilter filter, IAnalysisWindow analysisWindow)
        {
            this.openedProject = project;
            this.projectType = projectType;
            this.filter = filter;

            if (project == null) {
                if (framesCapturer != null) {
                    framesCapturer.Dispose ();
                    framesCapturer = null;
                }
                return;
            }

            if (projectType == ProjectType.FileProject) {
                framesCapturer = Config.MultimediaToolkit.GetFramesCapturer ();
                framesCapturer.Open (openedProject.Description.FileSet.First ().FilePath);
            }
            this.analysisWindow = analysisWindow;
            player = analysisWindow.Player;
            capturer = analysisWindow.Capturer;
        }
Example #21
0
 public WeaponDrawer(IPlayerController playerController, IPlayerList playerList, List<IWeaponView> weaponViews)
 {
     this.playerController = playerController;
     this.playerList = playerList;
     this.weaponViews = weaponViews;
 }
 public DefaultPlayerControllerModifier(IPlayerController playerController)
 {
     _playerController = playerController;
 }
 public PlayerCommandsHandler(IPlayerController player, IRegionManager regionManager)
 {
     _player = player;
     _regionManager = regionManager;
 }
Example #24
0
        void HandleOpenedPresentationChanged(OpenedPresentationChangedEvent e)
        {
            if (e.Player == null)
                return;
            this.player = e.Player;

            projectType = ProjectType.None;
            analysisWindow = null;
        }
Example #25
0
 void HandleOpenedProjectChanged(OpenedProjectEvent e)
 {
     this.analysisWindow = e.AnalysisWindow as IAnalysisWindow;
     capturer = e.AnalysisWindow.Capturer;
     player = e.AnalysisWindow.Player;
     openedProject = e.Project as ProjectLongoMatch;
     this.projectType = e.ProjectType;
     if (e.Project == null) {
         dashboard = null;
     } else {
         dashboard = e.Project.Dashboard;
     }
     ReloadHotkeys ();
 }
 public FastMovementPlayerControllerModifier(IPlayerController playerController)
 {
     _startTime = Time.time;
     _playerController = playerController;
 }
Example #27
0
 public void SetPlayerController(IPlayerController playerController)
 {
     this.playerController = playerController;
 }
Example #28
0
 /// <summary>
 /// Add a controller to the list of those to be notified of events.
 /// </summary>
 /// <remarks>A controller doesn't have to be in the list to send commands.</remarks>
 public void AddController(IPlayerController Controller)
 {
     if (ControlSets.Contains(Controller)) return; // only once!
     var new_set = new List<IPlayerController>(ControlSets){Controller};
     ControlSets = new_set;
 }
Example #29
0
        void HandleOpenedProjectChanged(OpenedProjectEvent e)
        {
            this.openedProject = e.Project;
            this.projectType = e.ProjectType;
            this.filter = e.Filter;

            this.analysisWindow = e.AnalysisWindow;
            player = e.AnalysisWindow.Player;
            capturer = e.AnalysisWindow.Capturer;
        }
 /// <summary>
 /// Initializing before the scene starts
 /// </summary>
 public void Awake()
 {
     instance = this;
     this.Init();
 }