Exemple #1
0
	public HamCharacter AddCharacter(string name)
	{
		int id = this.IDCount++;
		HamCharacter character = new HamCharacter(id, name);
		this.Characters[id] = character;
		return character;
	}
Exemple #2
0
	public void Unpack(DataUnpacker unpacker)
	{
		int versionInt;
		unpacker.Unpack(out versionInt);
		// TODO - In the future, we'll want to have separate unpacker functions based on version diffs
		//        For now there aren't any, but we'll stick this version int here for when that day arrives

		unpacker.Unpack(out this.Name);
		unpacker.Unpack(out this.IDCount);
		unpacker.Unpack(out this.OriginNodeID);
		unpacker.Unpack(out this.NarratorID);
		unpacker.Unpack(out this.DefaultSceneID);

		int numVars;
		unpacker.Unpack(out numVars);
		for (int i = 0; i < numVars; ++i)
		{
			HamTimelineVariable variable = new HamTimelineVariable();
			variable.Unpack(unpacker);
			this.Variables[variable.ID] = variable;
		}

		int numScenes;
		unpacker.Unpack(out numScenes);
		for (int i = 0; i < numScenes; ++i)
		{
			HamScene scene = new HamScene();
			scene.Unpack(unpacker);
			this.Scenes[scene.ID] = scene;
		}

		int numCharacters;
		unpacker.Unpack(out numCharacters);
		for (int i = 0; i < numCharacters; ++i)
		{
			HamCharacter character = new HamCharacter();
			character.Unpack(unpacker);
			this.Characters[character.ID] = character;
		}

		int numNodes;
		unpacker.Unpack(out numNodes);
		for (int i = 0; i < numNodes; ++i)
		{
			HamTimelineNode node;
			HamTimelineNode.Unpack(out node, unpacker);
			this.Nodes[node.ID] = node;
		}
	}
Exemple #3
0
	public HamCharacterLeavesEvent(HamCharacter character) : base(HamEventType.CharacterLeaves)
	{
		this.Character = character;
	}
Exemple #4
0
	public HamDialogEvent(HamCharacter speaker, string dialog) : base(HamEventType.Dialog)
	{
		this.Speaker = speaker;
		this.Dialog = dialog;
	}
Exemple #5
0
	public HamCharacterEntersEvent(HamCharacter character) : base(HamEventType.CharacterEnters)
	{
		this.Character = character;
	}