private static PresenceConfiguration CreatePresenceConfigurationFromRecord(IDataRecord record) { var id = record.GetValue <int>("id"); var presenceType = (PresenceType)record.GetValue <int>("presencetype"); var topX = record.GetValue <int>("topx"); var topY = record.GetValue <int>("topy"); var bottomX = record.GetValue <int>("bottomx"); var bottomY = record.GetValue <int>("bottomy"); var p = new PresenceConfiguration(id, presenceType) { name = record.GetValue <string>("name"), note = record.GetValue <string>("note"), spawnId = record.GetValue <int?>("spawnid"), roaming = record.GetValue <bool>("roaming"), roamingRespawnSeconds = record.GetValue <int>("roamingRespawnSeconds"), maxRandomFlock = record.GetValue <int?>("maxrandomflock") ?? 0, randomCenterX = record.GetValue <int?>("randomcenterx"), randomCenterY = record.GetValue <int?>("randomcentery"), randomRadius = record.GetValue <int?>("randomradius"), dynamicLifeTime = record.GetValue <int?>("dynamiclifetime"), isRespawnAllowed = record.GetValue <bool>("isrespawnallowed"), area = new Area(topX, topY, bottomX, bottomY) }; return(p); }
public DynamicPresence(IZone zone, PresenceConfiguration configuration) : base(zone, configuration) { if (Configuration.dynamicLifeTime != null) { LifeTime = TimeSpan.FromMilliseconds((int)Configuration.dynamicLifeTime); } }
public DirectPresence(IZone zone, PresenceConfiguration configuration, IRobotTemplateRelations robotTemplateRelations, FlockConfigurationBuilder.Factory flockConfigurationBuilderFactory) : base(zone, configuration) { _robotTemplateRelations = robotTemplateRelations; _flockConfigurationBuilderFactory = flockConfigurationBuilderFactory; }
public RandomPresence(IZone zone, PresenceConfiguration configuration, IRandomFlockSelector randomFlockSelector) : base(zone, configuration) { _randomFlockSelector = randomFlockSelector; }
public RoamingPresence(IZone zone, PresenceConfiguration configuration) : base(zone, configuration) { _fsm = new StackFSM(); _fsm.Push(new SpawnState(this)); }
public DynamicPoolPresence(IZone zone, PresenceConfiguration configuration, IRandomFlockReader randomFlockReader) : base(zone, configuration) { _randomFlockReader = randomFlockReader; }
public Presence(IZone zone, PresenceConfiguration configuration) { Zone = zone; Configuration = configuration; }
private Presence CreatePresence(PresenceConfiguration configuration) { return(_presenceFactory(_zone, configuration)); }