Buddy Rail
Buddy Rail
CC#
Created by HD-Fr0sT on 12/22/2023 in #help
✅ Is there a way to add if statements and bools in a class?
But inheritance is definitely the way to go.
37 replies
CC#
Created by HD-Fr0sT on 12/22/2023 in #help
✅ Is there a way to add if statements and bools in a class?
class Foo
{
public bool Interactable { get; set; } = true;

private List<int> _stuff;
public List<int> Stuff
{
get => _stuff;
set { if (Interactable) _stuff = value; }
}
}
class Foo
{
public bool Interactable { get; set; } = true;

private List<int> _stuff;
public List<int> Stuff
{
get => _stuff;
set { if (Interactable) _stuff = value; }
}
}
37 replies
CC#
Created by HD-Fr0sT on 12/22/2023 in #help
✅ Is there a way to add if statements and bools in a class?
You could do it with a constructor in the for the variable you wanted to toggle.
37 replies