public override void Action(SwitchesStory story, Location location) { int switchId = story.switchMap[location].Key; SwitchStory switchStory = (SwitchStory)story.subStories[switchId]; switchStory.SetState(SwitchState.OFF); }
SwitchState GetSwitchState(Location location) { int switchId = switchMap[location].Key; SwitchStory switchStory = (SwitchStory)subStories[switchId]; return switchStory.state ; }
public bool IsSwitchOn(Door door) { int switchId = doorMap[door]; SwitchStory switchStory = (SwitchStory)subStories[switchId]; return switchStory.state == SwitchState.ON; }
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)); }
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(); }