Jump to content

Problems defining Position[]


PizzaBoxBoy2

Recommended Posts

When defining a position array like so:

	private Position[] path = {
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

I get an error on new Position

Cannot instantiate the type Position 

Any Ideas on what is causing this? Both tutorials available for walking haven't helped. 
Any help?

 

//Pizza

Edited by PizzaBoxBoy2
Link to comment
Share on other sites

When defining a position array like so:

	private Position[] path = {
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

I get an error on new Position

Cannot instantiate the type Position 

Any Ideas on what is causing this? Both tutorials available for walking haven't helped. 

Any help?

private Position[] path = new Position[]{
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};
Link to comment
Share on other sites

private Position[] path = new Position[]{
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

 

This doesn't matter, since you can initiliaze with just {} behind your declaration ;)

If you initialize it later on you have to do it this way :D

When defining a position array like so:

	private Position[] path = {
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

I get an error on new Position

Cannot instantiate the type Position 

Any Ideas on what is causing this? Both tutorials available for walking haven't helped. 

Any help?

 

//Pizza

 

Recheck your imports :)

Use the osbot import instead <3

 

Khaleesi

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...