示例#1
0
        private StaticElement GetTileForDynamicElement(DynamicElement elem, Point position)
        {
            if (elem is Bridge)
            {
                return(new Water(position));
            }

            return(new Floor(position));
        }
示例#2
0
        private int GetCharacterWeight(DynamicElement character)
        {
            if (character is Hero)
            {
                return(baseNodeWeight);
            }

            return(currScenarioWidth * currScenarioHeight);
        }
示例#3
0
        private int GetObjectWeight(DynamicElement obj)
        {
            if (obj is Bridge || obj is IronDoor || obj is BronzeDoor)
            {
                return(currScenarioWidth * currScenarioHeight);
            }

            return(baseNodeWeight);
        }
示例#4
0
        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);
        }
示例#5
0
        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();
        }
示例#6
0
 private void CreateClimbLadderAction(DynamicElement character, out BaseAction action, out ActionArg arg)
 {
     action = new ClimbLadderAction();
     arg    = new ClimbLadderArg(character, MapElements.LADDER);
 }
示例#7
0
 private void CreateAttackAction(DynamicElement character, out BaseAction action, out ActionArg arg)
 {
     action = new AttackAction();
     arg    = new AttackActionArg(character, MapElements.ENEMY, MapElements.WEAPON, MapElements.SHIELD);
 }
示例#8
0
 private void CreatePullLeverAction(DynamicElement character, out BaseAction action, out ActionArg arg)
 {
     action = new PullLeverAction();
     arg    = new PullLeverArg(character);
 }
示例#9
0
 private void CreateGetObjectAction(DynamicElement character, out BaseAction action, out ActionArg arg)
 {
     action = new GetObjectAction();
     arg    = new GetObjectArg(character);
 }
示例#10
0
 public void RemObjectFromScenario(DynamicElement obj)
 {
     ObjectsList.Remove(obj);
 }
示例#11
0
 public void RemCharacterFromScenario(DynamicElement character)
 {
     CharactersList.Remove(character);
 }
示例#12
0
 private ScenarioElement CreateCharacter(Point position, DynamicElement character)
 {
     CharactersList.Add(character);
     return(character);
 }
示例#13
0
 private ScenarioElement CreateObject(Point position, DynamicElement obj)
 {
     ObjectsList.Add(obj);
     return(obj);
 }