❔ does an interface go inside a generic parent class?
here is the parent class for my state machine, all states will have a
processInput()
and processPhysics
, do I create an IState
interface inside or outside of parent class? I ask because I am translating this from another language and I think this is a pseudo interface5 Replies
Interfaces are, usually, placed in a separate file
Also, as a side note, C# uses
PascalCase
for method names
And lowercase string
Alright my next question is where do I implement the interface?
Do I do so in the parent class in code above or do I do it each time for each child class?
Whichever you prefer
Interfaces are inherited by the children of the class that implements them, though
If
Foo
implements IFoo
, then Bar : Foo
also implements IFoo
makes sense. thanks
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.