Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 *
 *	Adventure Creator
 *	by Chris Burton, 2013-2014
 *	
 *	"GVar.cs"
 * 
 *	This script is a data class for project-wide variables.
 * 
 */

using AC;

[System.Serializable]
public class GVar
{
	
	public string label;
	public int val;				// For bools, 0 = false, 1 = true
	public string textVal;
	public VariableType type;
	public int id;				// Internal ID to allow order-independence
	
	
	public GVar ()
	{
		val = 0;
		textVal = "";
		type = VariableType.Boolean;
		id = 0;

		label = "Variable " + (id + 1).ToString ();
	}
	
	
	public GVar (int[] idArray)
	{
		val = 0;
		textVal = "";
		type = VariableType.Boolean;
		id = 0;
		
		// Update id based on array
		foreach (int _id in idArray)
		{
			if (id == _id)
			{
				id ++;
			}
		}
		
		label = "Variable " + (id + 1).ToString ();
	}
	
	
	public GVar (GVar assetVar)
	{
		// Duplicates Asset to Runtime instance
		// (Do it the long way to ensure no connections remain to the asset file)
		
		val = assetVar.val;
		textVal = assetVar.textVal;
		type = assetVar.type;
		id = assetVar.id;
		label = assetVar.label;
	}
	
}

Commits for Nextrek/SpaceCrew/SpaceCrew/Assets/AdventureCreator/Scripts/Variables/GVar.cs

Diff revisions: vs.
Revision Author Commited Message
83 FMMortaroli picture FMMortaroli Tue 13 May, 2014 11:32:51 +0000