Exemplo n.º 1
0
        public override void Action(SwitchesStory story, Location location)
        {
            int switchId = story.switchMap[location].Key;
            SwitchStory switchStory = (SwitchStory)story.subStories[switchId];

            switchStory.SetState(SwitchState.OFF);
        }
Exemplo n.º 2
0
    SwitchState GetSwitchState(Location location)
    {
        int switchId = switchMap[location].Key;
        SwitchStory switchStory = (SwitchStory)subStories[switchId];

        return switchStory.state ;
    }
Exemplo n.º 3
0
    public bool IsSwitchOn(Door door)
    {
        int switchId = doorMap[door];

        SwitchStory switchStory = (SwitchStory)subStories[switchId];
        return switchStory.state == SwitchState.ON;
    }
Exemplo n.º 4
0
        public override void Action(SwitchesStory story, Location location)
        {
            int switchId = story.switchMap[location].Key;
            Door doorToOpen = story.switchMap[location].Value;
            SwitchStory switchStory = (SwitchStory)story.subStories[switchId];

            Debug.Log("Activate Switch" + location+" for "+doorToOpen);

            switchStory.SetState(SwitchState.ON);

            story.storiesHelper.Dispatch(DoorStory.OpenDoorFactory.Get(doorToOpen));

            story.storiesHelper.Dispatch(TimedActionsStory.AddTimedActiontFactory.Get(DectivateSwitchFactory.Get(location),20, false));
        }
Exemplo n.º 5
0
    void MapStoriesToProps(Story story)
    {
        SwitchesStory switchesStory = story.Get <SwitchesStory>();
        SwitchStory   switchStory   = switchesStory.GetStory(location);
        SwitchState   state         = switchStory.state;


        if (state == SwitchState.OFF)
        {
            gameObject.GetComponent <SpriteRenderer>().sprite = switchOffSprite;
        }
        else
        {
            gameObject.GetComponent <SpriteRenderer>().sprite = switchOnSprite;
        }
        // SwitchStory switchStory =
        // Dictionary<Enemy, Location> characterLocations= story.Get<EnemyPositionStory>().characterLocations;
        // Text text = GetComponent<Text>();

        // text.text = enemy.ToString() + ":" +characterLocations[enemy].ToString();
    }