public GameWorld(ControlManager controlManagerRef)
        {
            ControlManagerRef = controlManagerRef;
            Map = new TileMap(200, 400);
            MainPlayer = new GamePlayer(this);
            MainPlayer.Name = "Osama Abulail";
            int cloudsCount = (Map.MapWidth*Map.MapHeight)/(20*20);
            CloudManager = new CloudManager(Map, cloudsCount, CloudDirection.West, 0.5f);
            MovementManager = new UnitMovementManager(this);
            SelectionManager = new UnitSelectionManager(this);
            DockManager = new DockManager(ControlManagerRef);
            UpperStatusBar = new UpperStatusBar(new Vector2(10, 0), MainPlayer, ControlManagerRef);

            _trees = new List<Tree>();

            // generate random trees.
            Random r = new Random();
            for (int i = 0; i < 4000; i++)
            {
                Point treeLoc = new Point(r.Next(0,Map.MapWidth), r.Next(0,Map.MapHeight));
                if (Map.MapCellAt(treeLoc).Walkable)
                {
                    Tree t = new Tree("tree" + r.Next(1, 26), this, treeLoc);
                    _trees.Add(t);
                }
            }

            // border
            _border = new PictureBox(GameGraphics.GetTexture("gameplay_border").SourceTexture,
               new Rectangle(0, 0, 1366, 768));
            ControlManagerRef.Add(_border);
        }
    private void SelectByID(int searchId)
    {
        ISelectionManager selectionManager = this.ultraGrid1;

        foreach (UltraGridRow row in this.ultraGrid1.Rows)
        {
            if (Convert.ToInt32(row.Cells["ID"].Value) == searchId)
            {
                if (ultraGrid1.ActiveRowScrollRegion.IsActiveScrollRegion)
                {
                    ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(row);

                    // Activating and selecting are two different things.
                    // Activating the row draws dotted border around it.
                    // Selecting the row highlights it with blue color by default.
                    row.Activated = true;
                    row.Selected  = true;
                    break;
                }
            }
        }
    }
        public async Task ActivateAsync(ISelectionManager taskListSelectionManager)
        {
            if (taskListSelectionManager == null)
            {
                throw new ArgumentNullException(nameof(taskListSelectionManager));
            }

            this.selectionManager = taskListSelectionManager;

            IStartupManager startupManager = Ioc.Resolve <IStartupManager>();
            bool            canPerformSync = await startupManager.HandleStartupAsync();

            if (!this.platformService.IsNetworkAvailable)
            {
                canPerformSync = false;
            }

            if (canPerformSync && this.synchronizationManager.CanSyncOnStartup)
            {
                await this.synchronizationManager.Sync();
            }
        }
 public OverSelectionState(ISelectionManager selectionManager, ISelectionComponent interior)
     : base(selectionManager, interior.Parent)
 {
     ComponentAtCursorPoint = interior;
 }
 public MovingSelectionState(ISelectionManager selectionManager, ISelectionComponent selectionComponent, Point location)
     : base(selectionManager, selectionComponent.Parent)
 {
     ComponentAtCursorPoint = selectionComponent;
     _actionStartLocation   = location;
 }
 public OverEdgeState(ISelectionManager selectionManager, ISelectionComponent edge)
     : base(selectionManager, edge.Parent)
 {
     ComponentAtCursorPoint = edge;
 }
 public SelectingState(ISelectionManager selectionManager, Point actionLocation)
     : base(selectionManager, null)
 {
     _start = actionLocation;
 }
Exemple #8
0
 private void Start()
 {
     //gameObjectSelectionManager = GameObject.FindGameObjectWithTag("PlayerUnitManager").GetComponent<PlayerGameObjectSelectionManager>();
     _SelectionManager = Managers._PlayerSelectionManager.GetComponents <ISelectionManager>().ThrowIfMoreThanOne();
 }
 // Use this for initialization
 void Start()
 {
     _SelectionManager = Managers._PlayerSelectionManager.GetComponents <ISelectionManager>().ThrowIfMoreThanOne();
     _OriginalColor    = GetComponent <Renderer>().material.color;
 }
        public static T GetSelectedItem <T>(this ISelectionManager <T> selectionManager, string scope = null)
        {
            Argument.IsNotNull(() => selectionManager);

            return(selectionManager.GetSelectedItems(scope).LastOrDefault());
        }
 protected DataProvider(IController parent, IDataProviderOwner owner, IColumnManager columnManager, IRowManager rowManager, ISelectionManager selectionManager)
     : base(parent)
 {
     Owner            = owner;
     ColumnManager    = columnManager ?? AddSubController(new ColumnManager(this, owner));
     RowManager       = rowManager ?? AddSubController(new RowManager(this, owner));
     SelectionManager = selectionManager ?? AddSubController(new SelectionManager(this, owner));;
 }
 public MouseInputManager(IUnityInput InputManager, ISelectionManager SelectionManager, IHexDatabase HexDatabase)
 {
     this.InputManager     = InputManager;
     this.SelectionManager = SelectionManager;
     this.HexDatabase      = HexDatabase;
 }
 /// <summary> This should be called from OnEnable of the EditorWindow during each Layout event. </summary>
 public EditorWindowMinimizer([NotNull] EditorWindow targetWindow, [CanBeNull] ISelectionManager windowSelectionManager, bool doAutoMinimize)
 {
     Setup(targetWindow, windowSelectionManager, doAutoMinimize);
 }
Exemple #14
0
 public SelectionForm(ISelectionManager selectionManager)
 {
     this.selectionManager = selectionManager;
     this.InitializeComponent();
     this.FillCourierTable();
 }
 private void Start()
 {
     _SelectionManager = Managers.GetPlayerSelectionManager().GetComponents <ISelectionManager>().ThrowIfMoreThanOne();
 }
 public IdleState(ISelectionManager selectionManager, Point actionLocation)
     : base(selectionManager, null)
 {
 }
        public SkillSelectionManager(IHexDatabase HexDatabase, IUnitSelectionManager UnitSelectionManager, ISelectionManager SelectionManager, ICrossPlayerController CrossPlayerController)
        {
            this.HexDatabase           = HexDatabase;
            this.UnitSelectionManager  = UnitSelectionManager;
            this.CrossPlayerController = CrossPlayerController;

            SelectionManager.HexClicked += OnHexClicked;
        }
 public void Start()
 {
     instance = this;
 }
        /// <summary>
        ///   Initialize a new game if new controllers/models/views are necessary. This is usually done 
        ///   when Options changes some settings and various objects need to be reinitialized.
        /// </summary>
        /// <param name = "players">Players playing the game</param>
        private void InitializeNewGame(Player[] players)
        {
            IsMouseVisible = true;
            _camera = new Camera(_graphics);

            // Why is the board starting at (1600,1100)? No one knows....
            _camera.PointTo(new Vector2(1600, 1100));

            _controller = Controller.CustomInstance(players);

            _selectionManager = _controller;

            _oldKeyboardState = Keyboard.GetState();

            _boardViewLayer = new BoardViewLayer(_graphics, _controller);

            _handViewLayer = new HandViewLayer(_graphics, _controller) {IsCustom = false};

            _customViewLayer = new HandViewLayer(_graphics, _controller) {IsCustom = true};

            // a blank tile for each player, colors get added later
            _playerSelection = new Tile[_controller.Players.Count()];
            for (int i = 0; i<_controller.Players.Count(); i++)
                _playerSelection[i] = new Blank {Owner = _controller.Players.ElementAt(i), Space = new Space()};
            _selectionPoint = new Point(0, 0);

            _moveCamera = true;

            _oldColor = Color.Wheat;

            _displayHelp = false;

            _endGame = false;

            base.Initialize();
        }