public NpcState(Game game, NpcInstance npc) : base(game) { this.Npc = npc; this.Npc.State = this; foreach (NpcAction key in Util.GetValues<NpcAction>()) { switch (key) { case NpcAction.None: case NpcAction.Walk: case NpcAction.Idle: case NpcAction.Talk: continue; default: if (!this.Npc.Actions.ContainsKey(key)) { if (MemoryContentManager.AssetExists(string.Concat(new object[4] { (object) "Character Animations\\", (object) this.Npc.Name, (object) "\\", (object) key }))) { this.Npc.Actions.Add(key, new NpcActionContent() { AnimationName = ((object) key).ToString() }); continue; } else continue; } else continue; } } if (MemoryContentManager.AssetExists("Character Animations\\" + this.Npc.Name + "\\Metadata")) npc.FillMetadata(ServiceHelper.Get<IContentManagerProvider>().CurrentLevel.Load<NpcMetadata>("Character Animations/" + npc.Name + "/Metadata")); this.CanIdle = this.Npc.Actions.ContainsKey(NpcAction.Idle); this.CanIdle2 = this.Npc.Actions.ContainsKey(NpcAction.Idle2); this.CanIdle3 = this.Npc.Actions.ContainsKey(NpcAction.Idle3); this.CanTalk = this.Npc.Actions.ContainsKey(NpcAction.Talk); this.CanWalk = this.Npc.Actions.ContainsKey(NpcAction.Walk); this.CanTurn = this.Npc.Actions.ContainsKey(NpcAction.Turn); this.CanBurrow = this.Npc.Actions.ContainsKey(NpcAction.Burrow); this.CanHide = this.Npc.Actions.ContainsKey(NpcAction.Hide); this.CanTakeOff = this.Npc.Actions.ContainsKey(NpcAction.TakeOff); }