#Enum,String Tuple übergabe

3 messages · Page 1 of 1 (latest)

pine lance
#

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
```csharp
(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?

red patio
#

hier gehts