-
I have read the reference but I can't find anything about it. Please help. Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
pfusik
Sep 25, 2023
Replies: 2 comments 10 replies
-
public abstract class MyClass
{
protected abstract void MyCallback();
} or: public class MyClass
{
protected virtual void MyCallback()
{
}
} and subclass in your target language. |
Beta Was this translation helpful? Give feedback.
10 replies
-
Another example: public abstract class ThreeIntsFull
{
protected abstract void OnFull!();
}
public class ThreeIntsContainer
{
int[3] Content;
int Count = 0;
public void Append(int value, ThreeIntsFull! fullCallback)
{
if (Count >= 3)
fullCallback.OnFull();
else
Content[Count++] = value;
}
} or: public abstract class ThreeIntsContainer
{
int[3] Content;
int Count = 0;
protected abstract void OnFull!();
public void Append(int value)
{
if (Count >= 3)
OnFull();
else
Content[Count++] = value;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another example:
or: