Синтаксис:
Используется csharp
public class BaseState
{
static BaseState idle;
static BaseState running;
static BaseState inAirState;
public static BaseState IdleState
{
get
{
if (idle == null)
{
idle = new CharacterIdleState();
}
return idle;
}
set
{
idle = value;
}
}
public static BaseState RunningState
{
get
{
if (running == null)
{
running = new CharacterRunningState();
}
return running;
}
set
{
running = value;
}
}
public static BaseState InAirState
{
get
{
if(inAirState == null)
{
inAirState = new CharacterRunningState();
}
return inAirState;
}
set
{
running = value;
}
}
}
{
static BaseState idle;
static BaseState running;
static BaseState inAirState;
public static BaseState IdleState
{
get
{
if (idle == null)
{
idle = new CharacterIdleState();
}
return idle;
}
set
{
idle = value;
}
}
public static BaseState RunningState
{
get
{
if (running == null)
{
running = new CharacterRunningState();
}
return running;
}
set
{
running = value;
}
}
public static BaseState InAirState
{
get
{
if(inAirState == null)
{
inAirState = new CharacterRunningState();
}
return inAirState;
}
set
{
running = value;
}
}
}