Sev
Sev
CC#
Created by Sev on 12/18/2022 in #help
❔ does an interface go inside a generic parent class?
using Godot;
using System;

public class StateTemplate : Node
{
public enum State {
Null,
Idle,
Run,
Fall,
Jump,
Dodge
}
[Export]
private String animation_name;
public Player Player;

public void enter()
{
Player.AnimSprite.Play(animation_name);
}
public void exit()
{}
public int processInput(InputEvent @event)
{
return (int)State.Null;
}
public int doProcess(float delta)
{
return (int)State.Null;
}
public int processPhysics(float delta)
{
return (int)State.Null;
}
}
using Godot;
using System;

public class StateTemplate : Node
{
public enum State {
Null,
Idle,
Run,
Fall,
Jump,
Dodge
}
[Export]
private String animation_name;
public Player Player;

public void enter()
{
Player.AnimSprite.Play(animation_name);
}
public void exit()
{}
public int processInput(InputEvent @event)
{
return (int)State.Null;
}
public int doProcess(float delta)
{
return (int)State.Null;
}
public int processPhysics(float delta)
{
return (int)State.Null;
}
}
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 interface
10 replies