Hi, i would love for the addition of the Ternary operator
Example:
condition ? trueReturn : falseReturn
It would also be nice to have null conditional operators
A?.B?.Do(C);
if A or B is null it returns early with null and wont error out, this would reduce the null checking bloat that would come with things like
ArmaReforgerScripted game = GetGame(); if (!game) return; PlayerController playerController = game.GetPlayerController(); if (!playerController) return; PlayerCamera playerCamera = playerController.GetPlayerCamera(); if (!playerCamera) return; IEntity cursorTarget = playerCamera.GetCursorTarget(); if (!cursorTarget) return;
down to just
IEntity cursorTarget = GetGame()?.GetPlayerController()?.GetPlayerCamera()?.GetCursorTarget(); if (!cursorTarget) return;