请问老师,我的Dir和IsMoving(已经标红)为什么报错显示:"上下文中不存在这个名称"
class Moveting : GameObject
{
public bool IsMoving { get; set; }
public int Speed { get; set; }
private Direction dir;
public Direction Dir;}
class MyTank:Moveting
{
public void KeyDown(KeyEventArgs args)
{
switch (args.KeyCode)
{case Keys.W:
Dir = Direction.Up;
IsMoving = true;
break;
}}