Example #1
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;
		}
	}
Example #2
0
	public HamScene AddScene(string name)
	{
		int id = this.IDCount++;
		HamScene scene = new HamScene(id, name);
		this.Scenes[id] = scene;
		return scene;
	}
Example #3
0
	public HamSceneChangesEvent(HamScene scene) : base(HamEventType.SceneChanges)
	{
		this.Scene = scene;
	}