Jump to content

Problems defining Position[]


Recommended Posts

Posted (edited)

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
Posted

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)
	};
Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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