public bool IsAccessible(IPositionnable elem) { TileFacade tile = (TileFacade)elem; GroundTile tileBase = (GroundTile)tile.GroundTile; return(tileBase.isWalkable); }
public bool MoveToNextTile() { if (this.path.Count == 0) { this.nextTile = null; return(false); } TileFacade tile = this.path.Dequeue(); if (tile == null || (this.filter != null && !this.filter.IsAccessible(tile))) { this.nextTile = null; return(false); } this.nextTile = tile; return(true); }
private void InitTilesMap() { for (int x = this.bounds.position.x; x < this.bounds.position.x + this.bounds.size.x; x++) { for (int y = this.bounds.position.y; y < this.bounds.position.y + this.bounds.size.y; y++) { GroundTile groundTile = (GroundTile)this.GroundMap.GetTile(new Vector3Int(x, y, 0)); if (groundTile == null) { continue; } StartTile startTile = (StartTile)this.StartMap.GetTile(new Vector3Int(x, y, 0)); Vector2Int coord = new Vector2Int(x, y); TileFacade tile = new TileFacade(coord, this.GetWorldPosFromCoord(coord), groundTile, startTile); this.tilesMap.Add(new Vector2Int(x, y), tile); } } }
private void ResolveSkill(Vector3 pos) { if (this.actor.Skills.Selected == null) { return; } TileFacade targetTile = this.tilemapManager.GetTileFromWorldPos(pos); if (targetTile == null) { return; } ActorFacade caster = this.actor; ActorFacade targetActor = (ActorFacade)targetTile.Agent; SkillInput input = new SkillInput(caster, targetTile, targetActor); this.skillQueueResolver.AddSkill(input, this.actor.Skills.Selected); this.CancelSkill(); }
public void SetTile(TileFacade tile) { this.tile = tile; this.transform.position = tile.WorldPos; tile.Agent = this; }
public SkillInput(ActorFacade caster, TileFacade targetTile, ActorFacade targetActor = null) { this.caster = caster; this.targetTile = targetTile; this.targetActor = targetActor; }
public MoveProcess(ActorFacade actor, TileFacade dest, ITopology topology, IFilter filter) { HashSet <TileFacade> path = DependencyLocator.getTileFinder().findPath(actor.GetTile(), dest, topology, filter); this.moveAlongPathProcess = new MoveAlongPathProcess(actor, path, null, this.moveSpeed, this.treshold); }
public TilePointMoving(Settings settings, TileFacade tileBehaviour) { _settings = settings; _tileBehaviour = tileBehaviour; }