You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
976 B
44 lines
976 B
1 month ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
using Sog;
|
||
|
using Sog.Service;
|
||
|
using ProtoCSStruct;
|
||
|
|
||
|
namespace Game
|
||
|
{
|
||
|
public interface IMovePathGenerator
|
||
|
{
|
||
|
void Update(MapActor actor, long nowMs);
|
||
|
}
|
||
|
|
||
|
public class MovePathGeneratorMgr : Singleton<MovePathGeneratorMgr>
|
||
|
{
|
||
|
private IMovePathGenerator[] m_movePathGenerator = new IMovePathGenerator[(int)MapActorMoveType.MAMTMax];
|
||
|
|
||
|
public MovePathGeneratorMgr()
|
||
|
{
|
||
|
RegisterAll();
|
||
|
}
|
||
|
|
||
|
public IMovePathGenerator GetGenerator(int iMoveType)
|
||
|
{
|
||
|
if (iMoveType > 0 && iMoveType < m_movePathGenerator.Length)
|
||
|
{
|
||
|
return m_movePathGenerator[iMoveType];
|
||
|
}
|
||
|
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
private void RegisterAll()
|
||
|
{
|
||
|
m_movePathGenerator[(int)MapActorMoveType.MAMTRandom] = new RandomPathGenerator();
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|