private int AddLightSource(ILightInfo info) { int id; do { id = Random.Range(1, Int32.MaxValue); } while (_permanentLightSources.ContainsKey(id)); _permanentLightSources.Add(id, info); return(id); }
/// <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); }
/// <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); }
public abstract int SetLightContinuous(ILightInfo info);
public abstract void SetLightForOneFrame(ILightInfo info);
public override int SetLightContinuous(ILightInfo info) { return(AddLightSource(info)); }
public override void SetLightForOneFrame(ILightInfo info) { //_tempLightSources.Add(info); }
/// <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); }