public void Place(ILocation targetLocation, Point targetPos) { _layer = targetLocation.Tilemap.Creatures; _layer.SetMappable(this, targetPos); Location = targetLocation; Position = targetPos; }
public void Place(ILocation targetLocation, Point targetPos) { _layer = targetLocation.Tilemap.Items; _layer.Set(this, targetPos); Location = targetLocation; Position = targetPos; }
public Player(ILocation location, Point position) { if (location != null) { _layer = location.Tilemap.Creatures; Place(location, position); location.Tilemap.UpdateFogOfWar(this); location.Tilemap.UpdateFieldOfVisibility(this); } else { throw new ArgumentNullException(); } Name = "hero"; Symbol = '@'; MaxHealth = 50; Health = MaxHealth; MaxExertion = 50; Lvl = 1; Exp = 0; ExpToNextLvl = 100; StartingWeapon = new WeaponType("dagger", 'D', 3, 3, 20); CurrentWeapon = new Weapon(null, null, StartingWeapon, null); }
public HealingPlant(ILocation location, Point position) { if (location != null) { _layer = location.Tilemap.Creatures; Place(location, position); } Name = "healing plant"; Symbol = '\u2663'; }
public Monster(ILocation location, Point position, MonsterType type, MonsterModifier modifier) { if (location != null) { _layer = location.Tilemap.Creatures; Place(location, position); } Type = type; Modifier = modifier; Health = MaxHealth; }
public Tilemap(ILocation location) { if (location != null) { Location = location; } else { throw new ArgumentNullException(); } ToUpdate = new List <IMappable>(); Width = Location.Bounds.Width; Height = Location.Bounds.Height; Bounds = new Rectangle(0, 0, Width, Height); Tiles = new Tile[Width, Height]; FogOfWar = new bool[Width, Height]; FieldOfVisibility = new bool[Width, Height]; Creatures = new TilemapLayer(this); Items = new TilemapLayer(this); }