Example #1
0
 void Awake()
 {
     Path =  GetComponentInChildren<PathMaker>().Setup(this);
     Charac =  GetComponentInChildren<CharacterManager>().Setup(this);
     Cam = Camera.main;
     UI = FindObjectOfType<Canvas>();
     changeLighting();
 }
        public void Return_EmptyCollection_For_Origin_Same_As_Destination()
        {
            var origin = BoardCoordinate.For(1, 1);
            var destination = BoardCoordinate.For(1, 1);

            var target = new PathMaker(origin, destination);

            Assert.IsFalse(target.GetPathToDestination().Any());
        }
        public void Return_Single_Point_For_Single_Move()
        {
            var origin = BoardCoordinate.For(4, 8);
            var destination = BoardCoordinate.For(4, 7);

            var target = new PathMaker(origin, destination);

            var path = target.GetPathToDestination();
            Assert.IsTrue(path.First().Matches(4, 7));
        }
Example #4
0
 public CharacterManager Setup(LevelManager _man)
 {
     Anims ["walk"].wrapMode = WrapMode.Loop;
     Anims ["run"].wrapMode = WrapMode.Loop;
     Anims ["idle"].wrapMode = WrapMode.Loop;
     Manager = _man;
     Path = _man.Path;
     CurrentMarker = Path.LineList[1];
     Anims.Play("walk");
     Parts = GetComponentInChildren<ParticleSystem>();
     return this;
 }
Example #5
0
		/// <summary>
		/// Handles key up events.
		/// </summary>
		/// <param name="e"></param>
		/// <returns>Returns true if the key is handled.</returns>
		protected bool HandleKeyUp(KeyEventArgs e)
		{
			// keep keypresses inside browser url bar
			if(e.Handled)
				return true;

			if (e.Alt)
			{
				// Alt key down
				switch(e.KeyCode)
				{
					case Keys.A:
						menuItemAlwaysOnTop_Click(this,e);
						return true;
					case Keys.Q:
						using( PropertyBrowserForm worldWindSettings = new PropertyBrowserForm( Settings, "World Wind Settings" ) )
						{
							worldWindSettings.Icon = this.Icon;
							worldWindSettings.ShowDialog();
						}
						return true;
					case Keys.W:
						menuItemOptions_Click(this, EventArgs.Empty);
						return true;
					case Keys.Enter:
						this.FullScreen = !this.FullScreen;
						return true;
					case Keys.F4:
						Close();
						return true;
				}
			}
			else if (e.Control)
			{
				// Control key down
				switch(e.KeyCode)
				{
					case Keys.C:
					case Keys.Insert:
						menuItemCoordsToClipboard_Click(this, e);
						return true;
					case Keys.F:
						return true;
					case Keys.H:
						if (progressMonitor != null)
						{
							bool wasVisible = progressMonitor.Visible;
							progressMonitor.Close();
							progressMonitor.Dispose();
							progressMonitor = null;
							if (wasVisible)
								return true;
						}

						progressMonitor = new ProgressMonitor();
						progressMonitor.Icon = this.Icon;
						progressMonitor.Show();
						return true;
					case Keys.I:
						menuItemConfigWizard_Click(this,e);
						return true;
					case Keys.N:
						menuItemOptions_Click(this,e);
						return true;
					case Keys.T:
						menuItemShowToolbar_Click(this,e);
						return true;
					case Keys.V:
						menuItemEditPaste_Click(this,e);
						return true;
					case Keys.S:
						menuItemSaveScreenShot_Click(this, e);
						return true;
				}
			}
			else if (e.Shift)
			{
				// Shift key down
				switch(e.KeyCode)
				{
					case Keys.Insert:
						menuItemEditPaste_Click(this,e);
						return true;
					case Keys.S:
						menuItemSunShading_Click(this, e);
						return true;
					case Keys.A:
						menuItemAtmosphericScattering_Click(this, e);
						return true;
				}
			}
			else
			{
				// Other or no modifier key
				switch(e.KeyCode)
				{
					//case Keys.B:
					//	menuItemWMS_Click(this, e);
					//	return true;
					case Keys.G:
						return true;
					case Keys.L:
						menuItemLayerManager_Click(this, e);
						return true;
					case Keys.P:
						if(this.pathMaker == null)
						{
							this.pathMaker = new PathMaker(this.worldWindow);
							this.pathMaker.Icon = this.Icon;
						}
						this.pathMaker.Visible = !this.pathMaker.Visible;
						return true;
					case Keys.V:
						if(this.placeBuilderDialog == null)
						{
							this.placeBuilderDialog = new PlaceBuilder( this.worldWindow );
							this.placeBuilderDialog.Icon = this.Icon;
						}

						this.placeBuilderDialog.Visible = !this.placeBuilderDialog.Visible;
						return true;
					case Keys.Escape:
						if (this.FullScreen)
						{
							this.FullScreen = false;
							return true;
						}
						break;
					case Keys.D1:
					case Keys.NumPad1:
						this.VerticalExaggeration = 1.0f;
						return true;
					case Keys.D2:
					case Keys.NumPad2:
						this.VerticalExaggeration = 2.0f;
						return true;
					case Keys.D3:
					case Keys.NumPad3:
						this.VerticalExaggeration = 3.0f;
						return true;
					case Keys.D4:
					case Keys.NumPad4:
						this.VerticalExaggeration = 4.0f;
						return true;
					case Keys.D5:
					case Keys.NumPad5:
						this.VerticalExaggeration = 5.0f;
						return true;
					case Keys.D6:
					case Keys.NumPad6:
						this.VerticalExaggeration = 6.0f;
						return true;
					case Keys.D7:
					case Keys.NumPad7:
						this.VerticalExaggeration = 7.0f;
						return true;
					case Keys.D8:
					case Keys.NumPad8:
						this.VerticalExaggeration = 8.0f;
						return true;
					case Keys.D9:
					case Keys.NumPad9:
						this.VerticalExaggeration = 9.0f;
						return true;
					case Keys.D0:
					case Keys.NumPad0:
						this.VerticalExaggeration = 0.0f;
						return true;
					case Keys.F1:
						this.menuItemAnimatedEarth_Click(this,e);
						return true;
					case Keys.F2:
						this.menuItemModisHotSpots_Click(this,e);
						return true;
					case Keys.F5:
						this.menuItemRefreshCurrentView_Click(this,e);
						return true;
					case Keys.F6:
						return true;
					case Keys.F7:
						this.menuItemShowLatLonLines_Click(this,e);
						return true;
					case Keys.F8:
						this.menuItemPlanetAxis_Click(this,e);
						return true;
					case Keys.F9:
						this.menuItemShowCrosshairs_Click(this,e);
						return true;
					case Keys.F10:
						this.menuItemShowPosition_Click(this,e);
						return true;
					case Keys.F11:
						this.menuItemConstantMotion_Click(this,e);
						return true;
					case Keys.F12:
						this.menuItemPointGoTo_Click(this,e);
						return true;
				}
			}
			return false;
		}
        public void Return_7_Spaces()
        {
            var target = new PathMaker(BoardCoordinate.For(1, 1), BoardCoordinate.For(8, 1));

            Assert.AreEqual<int>(7, target.GetPathToDestination().Count());
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.label1        = new System.Windows.Forms.Label();
     this.ServerIpText  = new System.Windows.Forms.TextBox();
     this.OKBtn         = new System.Windows.Forms.Button();
     this.CancelBtn     = new System.Windows.Forms.Button();
     this.extraDetails  = new System.Windows.Forms.Label();
     this.useDefaultBtn = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.Location = new System.Drawing.Point(10, 10);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(270, 13);
     this.label1.TabIndex = 0;
     this.label1.Text     = "Enter the IP Address for the Validation Server:";
     //
     // ServerIpText
     //
     this.ServerIpText.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ServerIpText.Location  = new System.Drawing.Point(14, 33);
     this.ServerIpText.MaxLength = 15;
     this.ServerIpText.Name      = "ServerIpText";
     this.ServerIpText.Size      = new System.Drawing.Size(251, 20);
     this.ServerIpText.TabIndex  = 1;
     this.ServerIpText.Text      = PathMaker.GetValidationServerIP();
     this.ServerIpText.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
     this.ServerIpText.WordWrap  = false;
     //
     // OKBtn
     //
     this.OKBtn.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.OKBtn.Location = new System.Drawing.Point(14, 87);
     this.OKBtn.Name     = "OKBtn";
     this.OKBtn.Size     = new System.Drawing.Size(72, 30);
     this.OKBtn.TabIndex = 2;
     this.OKBtn.Text     = "OK";
     this.OKBtn.UseVisualStyleBackColor = true;
     this.OKBtn.Click += new System.EventHandler(this.OKBtn_Click);
     //
     // CancelBtn
     //
     this.CancelBtn.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.CancelBtn.Location = new System.Drawing.Point(193, 88);
     this.CancelBtn.Name     = "CancelBtn";
     this.CancelBtn.Size     = new System.Drawing.Size(72, 29);
     this.CancelBtn.TabIndex = 4;
     this.CancelBtn.Text     = "Cancel";
     this.CancelBtn.UseVisualStyleBackColor = true;
     this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
     //
     // extraDetails
     //
     this.extraDetails.AutoSize = true;
     this.extraDetails.Location = new System.Drawing.Point(40, 62);
     this.extraDetails.Name     = "extraDetails";
     this.extraDetails.Size     = new System.Drawing.Size(203, 13);
     this.extraDetails.TabIndex = 5;
     this.extraDetails.Text     = "Other servers include .202, .173 and .240";
     //
     // useDefaultBtn
     //
     this.useDefaultBtn.Location = new System.Drawing.Point(104, 87);
     this.useDefaultBtn.Name     = "useDefaultBtn";
     this.useDefaultBtn.Size     = new System.Drawing.Size(72, 29);
     this.useDefaultBtn.TabIndex = 3;
     this.useDefaultBtn.Text     = "Use Default";
     this.useDefaultBtn.UseVisualStyleBackColor = true;
     this.useDefaultBtn.Click += new System.EventHandler(this.useDefaultBtn_Click);
     //
     // ModifyServerIp
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(284, 125);
     this.Controls.Add(this.useDefaultBtn);
     this.Controls.Add(this.extraDetails);
     this.Controls.Add(this.CancelBtn);
     this.Controls.Add(this.OKBtn);
     this.Controls.Add(this.ServerIpText);
     this.Controls.Add(this.label1);
     this.Name = "ModifyServerIp";
     this.Text = "Modify Server IP";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #8
0
 // Start is called before the first frame update
 void Start()
 {
     pathMaker = GameObject.Find("System").transform.Find("Path Maker").GetComponent <PathMaker>();
     CellArea  = GameObject.Find("Cell").transform.Find("Cell Area").GetComponent <BoxCollider2D>().bounds;
 }
 void Start()
 {
     hunger  = gameObject.GetComponent <Hunger> ();
     holding = false;
     myPM    = GameObject.FindGameObjectWithTag("GameController").GetComponent <PathMaker> ();
 }
Example #10
0
    private void Start()
    {
        PM = GameObject.Find("GameManager").GetComponent <PathMaker>();

        PM.startSpawners.Add(this);
    }
Example #11
0
        public void Return_7_Spaces()
        {
            var target = new PathMaker(BoardCoordinate.For(1, 1), BoardCoordinate.For(8, 1));

            Assert.AreEqual <int>(7, target.GetPathToDestination().Count());
        }