private StaticElement GetTileForDynamicElement(DynamicElement elem, Point position) { if (elem is Bridge) { return(new Water(position)); } return(new Floor(position)); }
private int GetCharacterWeight(DynamicElement character) { if (character is Hero) { return(baseNodeWeight); } return(currScenarioWidth * currScenarioHeight); }
private int GetObjectWeight(DynamicElement obj) { if (obj is Bridge || obj is IronDoor || obj is BronzeDoor) { return(currScenarioWidth * currScenarioHeight); } return(baseNodeWeight); }
public bool CreateInteraction(InteractionType type, DynamicElement character, out BaseAction action, out ActionArg arg) { if (interactionsCreator.ContainsKey(type) != true) { action = null; arg = null; return(false); } interactionsCreator[type](character, out action, out arg); return(true); }
private void CreateUseKeyAction(DynamicElement character, out BaseAction action, out ActionArg arg) { var keyType = MapElements.EMPTY; var doorType = MapElements.EMPTY; if (BaseAction.IsObjectAround(currScenario, character.Position, MapElements.IRON_DOOR) && currScenario.PlayerHasObject(MapElements.IRON_KEY)) { keyType = MapElements.IRON_KEY; doorType = MapElements.IRON_DOOR; } if (BaseAction.IsObjectAround(currScenario, character.Position, MapElements.BRONZE_DOOR) && currScenario.PlayerHasObject(MapElements.BRONZE_KEY)) { keyType = MapElements.BRONZE_KEY; doorType = MapElements.BRONZE_DOOR; } arg = new UseKeyArg(character, keyType, doorType); action = new UseKeyAction(); }
private void CreateClimbLadderAction(DynamicElement character, out BaseAction action, out ActionArg arg) { action = new ClimbLadderAction(); arg = new ClimbLadderArg(character, MapElements.LADDER); }
private void CreateAttackAction(DynamicElement character, out BaseAction action, out ActionArg arg) { action = new AttackAction(); arg = new AttackActionArg(character, MapElements.ENEMY, MapElements.WEAPON, MapElements.SHIELD); }
private void CreatePullLeverAction(DynamicElement character, out BaseAction action, out ActionArg arg) { action = new PullLeverAction(); arg = new PullLeverArg(character); }
private void CreateGetObjectAction(DynamicElement character, out BaseAction action, out ActionArg arg) { action = new GetObjectAction(); arg = new GetObjectArg(character); }
public void RemObjectFromScenario(DynamicElement obj) { ObjectsList.Remove(obj); }
public void RemCharacterFromScenario(DynamicElement character) { CharactersList.Remove(character); }
private ScenarioElement CreateCharacter(Point position, DynamicElement character) { CharactersList.Add(character); return(character); }
private ScenarioElement CreateObject(Point position, DynamicElement obj) { ObjectsList.Add(obj); return(obj); }