当前位置: 首页>>代码示例>>C#>>正文


C# IZone类代码示例

本文整理汇总了C#中IZone的典型用法代码示例。如果您正苦于以下问题:C# IZone类的具体用法?C# IZone怎么用?C# IZone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IZone类属于命名空间,在下文中一共展示了IZone类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Team

        public Team(IZone zone, JoinCondition join_condition)
        {
            _JoinCondidion = join_condition;

            _Zone = zone;
            _Handlers = new Utility.TUpdater<MemberHandler>();
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:7,代码来源:RealmTeam.cs

示例2: Jet

 /// <summary>
 /// The constructor creates a Jet action for use by 
 /// an emitter. To add a Jet to all particles created by an emitter, use the
 /// emitter's addAction method.
 /// 
 /// @see org.flintparticles.emitters.Emitter#addAction()
 /// </summary>
 /// <param name="accelerationX">The x coordinate of the acceleration to apply, in pixels 
 /// per second per second.</param>
 /// <param name="accelerationY">The y coordinate of the acceleration to apply, in pixels 
 /// per second per second.</param>
 /// <param name="zone">The zone in which to apply the acceleration.</param>
 /// <param name="invertZone">If false (the default) the acceleration is applied only to particles inside 
 /// the zone. If true the acceleration is applied only to particles outside the zone.</param>
 public Jet(double accelerationX, double accelerationY, IZone zone, bool invertZone)
 {
     m_x = accelerationX;
     m_y = accelerationY;
     m_zone = zone;
     m_invert = invertZone;
 }
开发者ID:JuroGandalf,项目名称:Ragnarok,代码行数:21,代码来源:Jet.cs

示例3: ComputeUtility

 public float ComputeUtility(IZone o, IZone d)
 {
     float sum = 0f;
     var flatO = this.ZoneSystem.GetFlatIndex( o.ZoneNumber );
     var flatD = this.ZoneSystem.GetFlatIndex( d.ZoneNumber );
     bool any = false;
     var zoneIndex = ( flatO * this.Zones.Length + flatD ) * this.Modes.Length;
     for ( int mode = 0; mode < this.Modes.Length; mode++ )
     {
         EnsureResult( flatO, mode );
         if ( this.Modes[mode].Feasible( o, d, this.SimulationTime ) )
         {
             var res = this.Modes[mode].CalculateV( o, d, this.SimulationTime );
             if ( !float.IsNaN( res ) )
             {
                 float v = (float)Math.Exp( res );
                 if ( this.Adjustments != null )
                 {
                     v *= this.Adjustments.GiveAdjustment( o, d, mode, (int)this.CurrentInteractiveCategory );
                 }
                 this.CurrentUtility[zoneIndex + mode] = v;
                 sum += v;
                 any = true;
             }
         }
     }
     return any ? (float)sum : float.NaN;
 }
开发者ID:Cocotus,项目名称:XTMF,代码行数:28,代码来源:FlatModeSplit.cs

示例4: Adventure

 public Adventure(Adventurer adventurer, Remoting.ISoulBinder binder, IZone zone)
 {
     _Adventurer = adventurer;
     _Zone = zone;
     this._Binder = binder;
     _Squad = new Squad(adventurer.Formation ,_Adventurer.Teammates, _Adventurer.Controller);
 }
开发者ID:jiowchern,项目名称:Regulus,代码行数:7,代码来源:Adventure.cs

示例5: ComputeAttraction

        public float ComputeAttraction(float[] flatAttraction, IZone[] zones, int numberOfZones)
        {
            float totalAttractions = 0;
            var demographics = this.Root.Demographics;
            var flatEmploymentRates = demographics.JobOccupationRates.GetFlatData();
            var flatJobTypes = demographics.JobTypeRates.GetFlatData();

            for ( int i = 0; i < numberOfZones; i++ )
            {
                var total = 0f;
                foreach ( var empRange in this.EmploymentStatusCategory )
                {
                    for ( int emp = empRange.Start; emp <= empRange.Stop; emp++ )
                    {
                        foreach ( var occRange in this.EmploymentStatusCategory )
                        {
                            for ( int occ = occRange.Start; occ <= occRange.Stop; occ++ )
                            {
                                var temp = flatEmploymentRates[i][emp][occ];
                                temp *= flatJobTypes[i][emp];
                                temp *= zones[i].Employment;
                                total += temp;
                            }
                        }
                    }
                }
                totalAttractions += ( flatAttraction[i] = total );
            }
            return totalAttractions;
        }
开发者ID:Cocotus,项目名称:XTMF,代码行数:30,代码来源:GTAModelGeneration.cs

示例6: CreateRoom

        /// <summary>
        /// Creates an uninitialized, sealed room.
        /// </summary>
        /// <param name="name">The name of the room.</param>
        /// <param name="owner">The zone that owns this room.</param>
        /// <returns>Returns an uninitialized room instance</returns>
        public Task<IRoom> CreateRoom(string name, IZone owner)
        {
            var room = new MudRoom(this.doorwayFactory, owner);
            room.SealRoom();

            return Task.FromResult((IRoom)room);
        }
开发者ID:danec020,项目名称:MudEngine,代码行数:13,代码来源:MudRoomFactory.cs

示例7: OnRequest

        public void OnRequest( IDataObjectOutputStream outStream,
                               Query query,
                               IZone zone,
                               IMessageInfo info )
        {
            // To be a successful publisher of data using the ADK, follow these steps

            // 1) Examine the query conditions. If they are too complex for your agent,
            // 	throw the appropriate SIFException

            // This example agent uses the autoFilter() capability of DataObjectOutputStream. Using
            // this capability, any object can be written to the output stream and the stream will
            // filter out any objects that don't meet the conditions of the Query. However, a more
            // robust agent with large amounts of data would want to pre-filter the data when it does its
            // initial database query.
            outStream.Filter = query;

            Console.WriteLine( "Responding to SIF_Request for StudentPersonal" );

            // 2) Write any data to the output stream
            foreach ( StudentPersonal sp in fData )
            {
                outStream.Write( sp );
            }
        }
开发者ID:rafidzal,项目名称:OpenADK-csharp,代码行数:25,代码来源:StudentPersonalProvider.cs

示例8: GetSifResponses

        public override ISifResponseIterator<StudentPersonal> GetSifResponses(Query query, IZone zone)
        {
            StudentPersonalIterator studentPersonalIterator = null;

            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            if (query.HasConditions)
            {
                string key = ExtractPrimaryKey(query);

                if (key == null)
                {
                    throw new SifException(SifErrorCategoryCode.RequestResponse, SifErrorCodes.REQRSP_UNSUPPORTED_QUERY_9, "SIF Query not supported.", zone);
                }
                else
                {
                    if (log.IsDebugEnabled) log.Debug("SIF Response requested for StudentPersonal with a SIF RefId of " + key + ".");
                    studentPersonalIterator = new StudentPersonalIterator(key);
                }

            }
            else
            {
                if (log.IsDebugEnabled) log.Debug("SIF Response requested for all StudentPersonals.");
                studentPersonalIterator = new StudentPersonalIterator(null);
            }

            return studentPersonalIterator;
        }
开发者ID:justinlumb,项目名称:SbpAgentFramework-dotNet,代码行数:32,代码来源:StudentPersonalPublisher.cs

示例9: AdkException

 /// <summary>  Constructs an exception with a detailed message that occurs in the
 /// context of a zone
 /// </summary>
 /// <param name="msg">A message describing the exception
 /// </param>
 /// <param name="zone">The zone associated with the exception
 /// </param>
 public AdkException(string msg,
                      IZone zone)
     : base(msg)
 {
     fZone = zone;
     fZoneId = zone == null ? null : zone.ZoneId;
 }
开发者ID:rafidzal,项目名称:OpenADK-csharp,代码行数:14,代码来源:AdkException.cs

示例10: SifException

 /// <summary>  Constructs an exception to wrap one or more SIF_Errors received from an
 /// inbound SIF_Ack message. This form of constructor is only called by
 /// the Adk.
 /// </summary>
 public SifException( SIF_Ack ack,
                      IZone zone )
     : base(null, zone)
 {
     fAck = ack;
     fError = ack != null ? ack.SIF_Error : null;
 }
开发者ID:rafidzal,项目名称:OpenADK-csharp,代码行数:11,代码来源:SIFException.cs

示例11: CalculateV

 public override float CalculateV(IZone origin, IZone destination, Time time)
 {
     if ( this.IsContained( origin, destination ) )
     {
         return this.Constant;
     }
     return 0f;
 }
开发者ID:Cocotus,项目名称:XTMF,代码行数:8,代码来源:RegionConstantUtilityComponent.cs

示例12: CalculateV

 public override float CalculateV(IZone origin, IZone destination, XTMF.Time time)
 {
     if ( IsContained( origin, destination ) )
     {
         return this.Aivtt * this.NetworkData.TravelTime( origin, destination, time ).ToMinutes();
     }
     return 0;
 }
开发者ID:Cocotus,项目名称:XTMF,代码行数:8,代码来源:RegionCheckedAIVTT.cs

示例13: Acces

 protected Acces(string nom, IZone zoneFrom, IZone zoneTo)
 {
     this.Nom = nom;
     ZoneFrom = zoneFrom;
     ZoneTo = zoneTo;
     zoneFrom.Access.Add(this);
     zoneTo.Access.Add(this);
 }
开发者ID:arjuna-goutier,项目名称:ProjetSimulation,代码行数:8,代码来源:Acces.cs

示例14: Other

 public IZone Other(IZone zone)
 {
     if (ZoneFrom == zone)
         return ZoneTo;
     if (ZoneTo == zone)
         return ZoneFrom;
     return null;
 }
开发者ID:arjuna-goutier,项目名称:ProjetSimulation,代码行数:8,代码来源:Acces.cs

示例15: MudRoom

 /// <summary>
 /// Initializes a new instance of the <see cref="MudRoom"/> class.
 /// </summary>
 /// <param name="doorFactory">The door factory used to create new doorway instances.</param>
 public MudRoom(IDoorwayFactory doorFactory, IZone owner)
 {
     this.actors = new List<IActor>();
     this.doorways = new List<IDoorway>();
     this.doorFactory = doorFactory;
     this.IsSealed = true;
     this.Owner = owner;
 }
开发者ID:danec020,项目名称:MudEngine,代码行数:12,代码来源:MudRoom.cs


注:本文中的IZone类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。