C
C#11mo ago
Eren

Need help calling the functions correctly

i have to call all the functions in the correct way for my project
33 Replies
Angius
Angius11mo ago
This is, like, the 5th time you're making this thread
Eren
ErenOP11mo ago
this is the project for context
Moods
Moods11mo ago
Pdf??
Eren
ErenOP11mo ago
its about something different each time i dont know why u keep bugging me i dont have time for that i have to deliver this in 1hr and have no idea how to do this
Angius
Angius11mo ago
At least would be nice if you learned to give some details This thread is equivalent to "can't make dish, here recipe, tomato"
Eren
ErenOP11mo ago
i just send a whole pdf showing the order i need it in
Angius
Angius11mo ago
And zero of your own code
Eren
ErenOP11mo ago
well i can send it its just alot alot so no ones gonna read that can i send a ss of what it looks like rn
Eren
ErenOP11mo ago
so on the right u see the xlasses
No description
Eren
ErenOP11mo ago
and in the main theres a bunch of functions too
Angius
Angius11mo ago
And I can see two errors, about the use of ref where you shouldn't be using it So... fix that If a parameter of a method is not declared as a ref parameter, you cannot pass values with ref either
Eren
ErenOP11mo ago
yes thats this
No description
Angius
Angius11mo ago
Judging by errors like "the method needs a parameter but you're calling it without any parameters" I'd say you should focus on learning the very basics of C#, and object-oriented programming in the first place, before even attempting a project like that There's only so much we can do here, I'm afraid But removing those ref keywords would be a start
Eren
ErenOP11mo ago
yeah im happy for u ur a better coder then me i was asking for the order it has to be and i send a file to see if u can check i and maybe tell me pretty easier said then done
Angius
Angius11mo ago
I can't read whatever language the PDF is in, so no idea But it seems like the structure of the program is neatly described, with a proper graph even So the starting point is taking that graph and turning it into classes
Eren
ErenOP11mo ago
im asking cuz i dont get it ive done basically everything i just want it in the mainnoz now
Angius
Angius11mo ago
The graph is extremely clear, actually, that I look at it
Angius
Angius11mo ago
Like, take Item
No description
Angius
Angius11mo ago
public class Item
{
private int _power;

public string Name { get; set; }
public int Power { get; set; }
public string Description { get; set; }

public Item(string name, int power, string description)
{
Name = name;
Power = power;
Description = description;
}

public string GetItemBattleInfo()
{
// code
}

public string GetInfo()
{
// code
}
}
public class Item
{
private int _power;

public string Name { get; set; }
public int Power { get; set; }
public string Description { get; set; }

public Item(string name, int power, string description)
{
Name = name;
Power = power;
Description = description;
}

public string GetItemBattleInfo()
{
// code
}

public string GetInfo()
{
// code
}
}
From the graph alone, you know exactly how your classes should look
Angius
Angius11mo ago
DamageItem:
No description
Angius
Angius11mo ago
public class DamageItem : Item
{
public DamageItem(string name, int power, string description)
{
Name = name;
Power = power;
Description = description;
}

public string DoDamage(Pokemon user, Pokemon target)
{
// code
}
}
public class DamageItem : Item
{
public DamageItem(string name, int power, string description)
{
Name = name;
Power = power;
Description = description;
}

public string DoDamage(Pokemon user, Pokemon target)
{
// code
}
}
Everything is super clear And the table below, I assume, tells you what the // code should do And the usage, well, since those are not static methods, also seems simple
Eren
ErenOP11mo ago
so just call them in the order they sent from 2.1 to the end ?
Angius
Angius11mo ago
As I said, I can't read this language But also... there is no set order You call them in the order that's needed If the menu selection is "use item" you need to do whatever is needed to use that item I can't tell you "first make a pokemon, then call this, then call that, then take the result and call something else"
Eren
ErenOP11mo ago
yeah okay i just dont know myself i have no idea
Angius
Angius11mo ago
Well, just think of what you need at any given point To use a damage item you need that item, the pokemon who uses it, and the pokemon it will be used on Then you can call item.DoDamage(poke1, poke2)
Jimmacle
Jimmacle11mo ago
if this is time critical then it's in your best interest to provide as much information as possible to help us help you but either way, putting this off until the last minute doesn't make it an emergency for anyone else you also won't find anyone to just do it for you
Eren
ErenOP11mo ago
not a last minute thing i just finished creating all the functions
Jimmacle
Jimmacle11mo ago
>i dont have time for that i have to deliver this in 1hr
Eren
ErenOP11mo ago
yes because without all the functions i cant use the main why is everyone here just being rude like if ur not gonna help just fuckoff i been working on this for 3 weeks plus i didnt start 3 days ago i just suck at coding and am asking for advice lower ur egos goddam
Joschi
Joschi11mo ago
The problem is, nobody here seems to have any clue what you actually want. What specifically is your question/problem? A giant (dutch?) pdf with your assignment doesn't help.
Moods
Moods11mo ago
why is everyone here just being rude
Assess the help you’ve gotten and the information you’ve provided, they’ve all done their best to be helpful and it’s rude on your part to think otherwise
Pobiega
Pobiega11mo ago
The only one being rude here is you. You provide no context every god damned time you open a new thread (about the same issue!). You seem to think everyone here knows you and your problem (obviously not true) and that they speak fluent dutch. You seem to think this place is dedicated to helping you on your terms. How help works on this discord is that the person asking for help asks a specific, well defined question with as much context as usual. This almost always involves code, a description of what they think the problem is, what they are trying to achieve and what they have tried up to this point. You can assume people answering know C#, but they don't have any information about your specific problem unless you provide it We also have absolutely no incentive what so ever to help you meet a deadline. We have no interest in solving this for you, we are here to help you learn how to solve it yourself. That will take time, time you don't seem to have.
Want results from more Discord servers?
Add your server