private int AddLightSource(ILightInfo info)
        {
            int id;

            do
            {
                id = Random.Range(1, Int32.MaxValue);
            } while (_permanentLightSources.ContainsKey(id));

            _permanentLightSources.Add(id, info);

            return(id);
        }
Esempio n. 2
0
 /// <summary>
 ///     Adds the light information.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="lightInfo">The light information.</param>
 public static void AddLightInfo(this NetworkMessage message, ILightInfo lightInfo)
 {
     message.AddByte(lightInfo.Level);
     message.AddByte(lightInfo.Color);
 }
Esempio n. 3
0
 /// <summary>
 ///     Adds the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="creatureId">The creature identifier.</param>
 /// <param name="lightInfo">The light information.</param>
 public static void Add(NetworkMessage message, uint creatureId, ILightInfo lightInfo)
 {
     message.AddPacketType(GamePacketType.CreatureLightInfo);
     message.AddUInt32(creatureId);
     message.AddLightInfo(lightInfo);
 }
Esempio n. 4
0
 public abstract int SetLightContinuous(ILightInfo info);
Esempio n. 5
0
 public abstract void SetLightForOneFrame(ILightInfo info);
 public override int SetLightContinuous(ILightInfo info)
 {
     return(AddLightSource(info));
 }
 public override void SetLightForOneFrame(ILightInfo info)
 {
     //_tempLightSources.Add(info);
 }
Esempio n. 8
0
 /// <summary>
 ///     Adds the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="lightInfo">The light information.</param>
 public static void Add(NetworkMessage message, ILightInfo lightInfo)
 {
     message.AddPacketType(GamePacketType.Ambient);
     message.AddByte(lightInfo.Level);
     message.AddByte(lightInfo.Color);
 }