Пример #1
0
        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);
        }
Пример #2
0
 public DynamicPresence(IZone zone, PresenceConfiguration configuration) : base(zone, configuration)
 {
     if (Configuration.dynamicLifeTime != null)
     {
         LifeTime = TimeSpan.FromMilliseconds((int)Configuration.dynamicLifeTime);
     }
 }
Пример #3
0
 public DirectPresence(IZone zone, PresenceConfiguration configuration,
                       IRobotTemplateRelations robotTemplateRelations,
                       FlockConfigurationBuilder.Factory flockConfigurationBuilderFactory) : base(zone, configuration)
 {
     _robotTemplateRelations           = robotTemplateRelations;
     _flockConfigurationBuilderFactory = flockConfigurationBuilderFactory;
 }
Пример #4
0
 public RandomPresence(IZone zone, PresenceConfiguration configuration, IRandomFlockSelector randomFlockSelector) : base(zone, configuration)
 {
     _randomFlockSelector = randomFlockSelector;
 }
Пример #5
0
 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;
 }
Пример #7
0
 public Presence(IZone zone, PresenceConfiguration configuration)
 {
     Zone          = zone;
     Configuration = configuration;
 }
Пример #8
0
 private Presence CreatePresence(PresenceConfiguration configuration)
 {
     return(_presenceFactory(_zone, configuration));
 }