public IEventExtender Create(MapExtender map, XleEvent evt, Type defaultExtender) { // It looks like defaultExtender is no longer required. // That would have some cascading refactoring, removing // all the overrides of ExtenderType for different event types. var result = serviceLocator.ResolveNamed <IEventExtender>(evt.ExtenderName); ((EventExtender)result).TheEvent = evt; return(result); }
protected async Task <bool> OpenEvent() { foreach (var evt in MapExtender.EventsAt(1).Where(x => x.Enabled)) { if (await evt.Open()) { return(true); } } return(false); }
private T Resolve <T>(MapExtender map, string name) where T : IXleMapRenderer { T result; if (name == null) { result = serviceLocator.Resolve <T>(); } else { result = serviceLocator.ResolveNamed <T>(name); } result.TheMap = map.TheMap; return(result); }
private DungeonMonster MonsterInFrontOfPlayer(Player player, ref int distance) { return(MapExtender.MonsterInFrontOfPlayer(player, ref distance)); }
public TempleRenderer TempleRenderer(MapExtender map, string name = null) => Resolve <TempleRenderer>(map, name);
public TownRenderer TownRenderer(MapExtender map, string name = null) => Resolve <TownRenderer>(map, name);
public OutsideRenderer OutsideRenderer(MapExtender map, string name = null) => Resolve <OutsideRenderer>(map, name);
public IMuseumRenderer MuseumRenderer(MapExtender map, string name = null) => Resolve <IMuseumRenderer>(map, name);
public DungeonRenderer DungeonRenderer(MapExtender map, string name = null) => Resolve <DungeonRenderer>(map, name);
public CastleRenderer CastleRenderer(MapExtender map, string name = null) => Resolve <CastleRenderer>(map, name);
public override async Task <bool> StepOn() { await MapExtender.LeaveMap(); return(true); }