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


C# Hashtable.StripToStringKeys方法代码示例

本文整理汇总了C#中System.Collections.Hashtable.StripToStringKeys方法的典型用法代码示例。如果您正苦于以下问题:C# Hashtable.StripToStringKeys方法的具体用法?C# Hashtable.StripToStringKeys怎么用?C# Hashtable.StripToStringKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Hashtable的用法示例。


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

示例1: OpSetCustomPropertiesOfRoom

 /// <summary>
 /// Sets custom properties of a room (only passing string-typed keys in the Hashtable).
 /// Internally this uses OpSetProperties, which can be used to either set room or player properties.
 /// </summary>
 /// <param name="gameProperties"></param>
 /// <returns>If the operation could be sent (has to be connected).</returns>
 public bool OpSetCustomPropertiesOfRoom(Hashtable gameProperties)
 {
     return this.OpSetPropertiesOfRoom(gameProperties.StripToStringKeys());
 }
开发者ID:nathanlarson,项目名称:wulf3,代码行数:10,代码来源:LoadBalancingPeer.cs

示例2: SetCustomProperties

        /// <summary>
        /// Updates and synchronizes the named properties of this Player with the values of propertiesToSet.
        /// </summary>
        /// <remarks>
        /// Any player's properties are available in a Room only and only until the player disconnect or leaves.
        /// Access any player's properties by: Player.CustomProperties (read-only!) but don't modify that hashtable.
        /// 
        /// New properties are added, existing values are updated.
        /// Other values will not be changed, so only provide values that changed or are new.
        /// To delete a named (custom) property of this player, use null as value.
        /// Only string-typed keys are applied (everything else is ignored).
        /// 
        /// Local cache is updated immediately, other players are updated through Photon with a fitting operation.
        /// To reduce network traffic, set only values that actually changed.
        /// </remarks>
        /// <param name="propertiesToSet">Hashtable of props to udpate, set and sync. See description.</param>
        public void SetCustomProperties(Hashtable propertiesToSet)
        {
            Hashtable customProps = propertiesToSet.StripToStringKeys() as Hashtable;

            // merge (delete null-values)
            this.CustomProperties.Merge(customProps);
            this.CustomProperties.StripKeysWithNullValues();

            // send (sync) these new values if in room
            if (this.RoomReference != null && this.RoomReference.IsLocalClientInside)
            {
                this.RoomReference.LoadBalancingClient.OpSetCustomPropertiesOfActor(this.actorID, customProps);
            }
        }
开发者ID:nathanlarson,项目名称:wulf3,代码行数:30,代码来源:Player.cs

示例3: OpSetCustomPropertiesOfActor

 /// <summary>
 /// Sets custom properties of a player / actor (only passing on the string-typed custom properties).
 /// Internally this uses OpSetProperties, which can be used to either set room or player properties.
 /// </summary>
 /// <param name="actorNr">The player ID (a.k.a. actorNumber) of the player to attach these properties to.</param>
 /// <param name="actorProperties">The custom properties to add or update.</param>
 /// <returns>If the operation could be sent (requires connection).</returns>
 public bool OpSetCustomPropertiesOfActor(int actorNr, Hashtable actorProperties)
 {
     return this.OpSetPropertiesOfActor(actorNr, actorProperties.StripToStringKeys());
 }
开发者ID:nathanlarson,项目名称:wulf3,代码行数:11,代码来源:LoadBalancingPeer.cs


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