Jump to content

[Tutorial][Indepth] A better take on task based scripts


Recommended Posts

Posted
Quote

 

 

8 hours ago, Promo said:

Sorry I am a total noob coder.
We have this code to add the task in this example:


@Override
public void onStart() {
    tasks.add(new Attack(this));

How do I add another task , for example Banking?
Can I put all name of task in an array list and pass that array list as argument to tasks.add( List here)(this)) ?

You make another class like the Attack one with your banking code in it :)
And then you can add it like the attack one 

tasks.add(new Banking(this));

 

Posted (edited)
On 4/12/2020 at 6:13 PM, Khaleesi said:

 

You make another class like the Attack one with your banking code in it :)
And then you can add it like the attack one 


tasks.add(new Banking(this));

 

Thanks for the reply Khaaleesi.

I've got something working now.

 

 

 

 

Edited by Promo

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...