public SkySystem(MapBase mapInfo) { timer = new Timer(); timer.Interval = TimeGranularity; timer.AutoReset = true; timer.Elapsed += CalcSkyRotation; timer.Enabled = true; map = mapInfo; fogto = FogLevel; fastTimer = new Delay(map); fastTimer.SetDelay(fastDelay, FastDelay); }
static void StaticUpdate() { for (int i = 0; i < GlobalServer.Maps.Count; i++) { MapBase currentMap = GlobalServer.Maps[i]; for (int j = 0; j < currentMap.blocks.Count; j++) { Block currentBlock = currentMap.blocks[j]; if (currentBlock.IsFirework()) { if (DateTime.Now - currentBlock.creationTime >= new TimeSpan(0, 0, FireworkKeepSeconds)) { List <string> data = new List <string>(); data.Add("removeBlock"); data.Add(currentBlock.blockId); currentMap.blocks.RemoveAt(j); j--; currentMap.SendAll(data); } } } } }
/// <summary> /// 从指定地图初始化 /// </summary> /// <param name="map">指定地图</param> public Delay(MapBase map) { mp = map; mp.delays.Add(this); }
public ThrownOutItems(MapBase map) { Items = new List <ThrownOutItem>(); Map = map; }