void ApplyChange(byte x, byte y, IconChangeType changeType, ushort value) { switch (changeType) { case IconChangeType.Underlay: ChangeUnderlay(x, y, value); break; case IconChangeType.Overlay: ChangeOverlay(x, y, value); break; case IconChangeType.Wall: break; // N/A for 2D map case IconChangeType.Floor: break; // N/A for 2D map case IconChangeType.Ceiling: break; // N/A for 2D map case IconChangeType.NpcMovement: break; case IconChangeType.NpcSprite: break; case IconChangeType.Chain: _mapData.SetZoneChain(x, y, value); break; case IconChangeType.BlockHard: PlaceBlock(x, y, value, true); break; case IconChangeType.BlockSoft: PlaceBlock(x, y, value, false); break; case IconChangeType.Trigger: _mapData.SetZoneTrigger(x, y, (TriggerTypes)value); break; default: throw new ArgumentOutOfRangeException(nameof(changeType), changeType, $"Unexpected change type \"{changeType}\""); } }
void ApplyChange(byte x, byte y, IconChangeType changeType, ushort value, MapChange.Enum2 unk3) { switch (changeType) { case IconChangeType.Underlay: ChangeUnderlay(x, y, value); break; case IconChangeType.Overlay: ChangeOverlay(x, y, value); break; case IconChangeType.Wall: break; // N/A for 2D map case IconChangeType.Floor: break; // N/A for 2D map case IconChangeType.Ceiling: break; // N/A for 2D map case IconChangeType.NpcMovement: break; case IconChangeType.NpcSprite: break; case IconChangeType.Chain: ChangeTileEventChain(x, y, value); break; case IconChangeType.BlockHard: PlaceBlock(x, y, value, true); break; case IconChangeType.BlockSoft: PlaceBlock(x, y, value, false); break; case IconChangeType.Trigger: ChangeTileEventTrigger(x, y, value); break; default: throw new ArgumentOutOfRangeException(); } }
public void Modify(byte x, byte y, IconChangeType changeType, ushort value, bool isTemporary) { ApplyChange(x, y, changeType, value); var collection = isTemporary ? TempChanges : PermChanges; collection.Update(Id, x, y, changeType, value); }
public ChangeIconEvent(short x, short y, EventScopes scopes, IconChangeType changeType, ushort value) { X = x; Y = y; Scopes = scopes; ChangeType = changeType; Value = value; }
public ChangeIconEvent(short x, short y, EventScope scope, IconChangeType changeType, ushort value, ChangeIconLayers layers) { X = x; Y = y; Scope = scope; ChangeType = changeType; Value = value; Layers = layers; }
public IMapLayer CreateMapLayer( LogicalMap2D logicalMap, ITexture tileset, Func <int, TileData> getTileFunc, DrawLayer layer, IconChangeType iconChangeType) { return(new MapLayer(logicalMap, tileset, getTileFunc, layer, iconChangeType)); }
public void Update(MapId mapId, byte x, byte y, IconChangeType type, ushort value) { foreach (var c in this) { if (c.MapId != mapId || c.X != x || c.Y != y || c.ChangeType != type) { continue; } c.Value = value; return; } Add(new MapChange { MapId = mapId, X = x, Y = y, ChangeType = type }); }
public void Update(MapId mapId, byte x, byte y, IconChangeType type, ushort value) { var change = this.FirstOrDefault(c => c.MapId == mapId && c.X == x && c.Y == y && c.ChangeType == type); if (change == null) { change = new MapChange { MapId = mapId, X = x, Y = y, ChangeType = type }; Add(change); } change.Value = value; }
public void Modify(byte x, byte y, IconChangeType changeType, ushort value, bool isTemporary) { ApplyChange(x, y, changeType, value, MapChange.Enum2.Norm); // Add / update temp/perm changes }
public DirtyTileEventArgs(int x, int y, IconChangeType type) { X = x; Y = y; Type = type; }
public IMapLayer CreateMapLayer(LogicalMap2D logicalMap, ITexture tileset, Func <int, TileData> getTileFunc, DrawLayer layer, IconChangeType iconChangeType) { throw new NotImplementedException(); }
protected void OnDirty(int x, int y, IconChangeType type) => Dirty?.Invoke(this, new DirtyTileEventArgs(x, y, type));
public TileLayer(LogicalMap2D logicalMap, ITexture tileset, Func <int, TileData> tileFunc, DrawLayer drawLayer, IconChangeType iconChangeType) { On <RenderEvent>(e => Render()); _logicalMap = logicalMap; _logicalMap.Dirty += (sender, args) => { if (args.Type == iconChangeType) { _dirty.Add((args.X, args.Y)); } }; _tileset = tileset; _tileFunc = tileFunc; _drawLayer = drawLayer; }