Coding Global Background
Coding Global

Enum,String Tuple übergabe

Archived 3 years ago
3 messages
0 members
Created 3 years ago
Updated 3 years ago
Open in Discord
N
Niclas3006
Django
Hi ich arbeite das erste mal mit tuples deswegen bin ich mir nicht 100% sicher ob es funktionieren wird.
ich habe diese methode die ein string und ein enum zurückgibt:
public (string, BlockType) getRandomBlockWithDifficultyAndTag(DIFFICULTY difficulty, BlockType currentBlocktype, bool forceTransition = false)
{
     return ("", BlockType.none);
}

der methodeninhalt ist aktuell nur ein platzhalter
(level[i],currentBlockType) = blockLibary.getRandomBlockWithDifficultyAndTag(difficulty, currentBlockType);

ich bräuchte ne documentation oder nen rat, ob die übergabe so funktioniert
also die übergabe vom string in das level string-array funktioniert.
Also das der tuple aufgespalten wird und dann quasi
level[i] = string
und
currentBlockType = Blocktype gemacht wird

oder wird das anders behandelt?

Replies (3)