/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="jumpLabel">飛び先のラベル</param>
		/// <param name="text">表示テキスト</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public AdvSelection(string jumpLabel, string text, ExpressionParser exp, StringGridRow row)
		{
			this.jumpLabel = jumpLabel;
			this.text = text;
			this.exp = exp;
			this.spriteName = "";
			this.row = row;
		}
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="label">ジャンプ先のラベル</param>
		/// <param name="spriteName">クリックを有効にするオブジェクト名</param>
		/// <param name="isPolygon">ポリゴンコライダーを使うか</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public AdvSelection(string jumpLabel, string spriteName, bool isPolygon, ExpressionParser exp, StringGridRow row)
		{
			this.jumpLabel = jumpLabel;
			this.text = "";
			this.exp = exp;
			this.spriteName = spriteName;
			this.isPolygon = isPolygon;
			this.row = row;
		}
		/// <summary>
		/// if文の開始
		/// </summary>
		/// <param name="param">判定に使う数値パラメーター</param>
		/// <param name="exp">判定式</param>
		public void BeginIf(AdvParamSetting param, ExpressionParser exp)
		{
			IsLoadInit = false;
			AdvIfData new_if = new AdvIfData();
			if (null != current)
			{
				new_if.Parent = current;
			}
			current = new_if;
			current.BeginIf(param, exp);
		}
		/// <summary>
		/// else if文の開始
		/// </summary>
		/// <param name="param">判定に使う数値パラメーター</param>
		/// <param name="exp">判定式</param>
		public void ElseIf(AdvParamSetting param, ExpressionParser exp)
		{
			if (current == null)
			{
				if(!IsLoadInit)
				{
					Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.ElseIf, exp));
				}
				current = new AdvIfData();
			}
			current.ElseIf(param, exp);
		}
		/// <summary>
		/// else if文の開始
		/// </summary>
		/// <param name="param">判定に使う数値パラメーター</param>
		/// <param name="exp">判定式</param>
		public void ElseIf(AdvParamSetting param, ExpressionParser exp)
		{
			if (!isIf)
			{
				isIf = param.CalcExpressionBoolean(exp);
				isSkpping = !isIf;
			}
			else
			{
				isSkpping = true;
			}
		}
Beispiel #6
0
 /// <summary>
 /// 選択肢追加
 /// </summary>
 /// <param name="label">ジャンプ先のラベル</param>
 /// <param name="text">表示テキスト</param>
 /// <param name="exp">選択時に実行する演算式</param>
 public void AddSelection(string label, string text, ExpressionParser exp, string prefabName, float?x, float?y, StringGridRow row)
 {
     selections.Add(new AdvSelection(label, text, exp, prefabName, x, y, row));
 }
Beispiel #7
0
 /// <summary>
 /// 数式を計算して結果を返す
 /// </summary>
 /// <param name="exp">数式</param>
 /// <returns>計算結果</returns>
 public object CalcExpression(ExpressionParser exp)
 {
     return(exp.CalcExp(GetParameter, TrySetParameter));
 }
Beispiel #8
0
 /// <summary>
 /// 選択肢追加
 /// </summary>
 /// <param name="label">ジャンプ先のラベル</param>
 /// <param name="text">表示テキスト</param>
 /// <param name="exp">選択時に実行する演算式</param>
 public void AddSelection(string label, string text, ExpressionParser exp, StringGridRow row)
 {
     selections.Add(new AdvSelection(label, text, exp, row));
 }
Beispiel #9
0
 /// <summary>
 /// 論理式を計算して結果を返す
 /// </summary>
 /// <param name="exp">数式</param>
 /// <returns>計算結果</returns>
 public bool CalcExpressionBoolean(ExpressionParser exp)
 {
     return(exp.CalcExpBoolean(GetParameter, TrySetParameter));
 }
Beispiel #10
0
        bool isIf = false;                              //if文がtrueになったか

        /// <summary>
        /// if文の開始
        /// </summary>
        /// <param name="param">判定に使う数値パラメーター</param>
        /// <param name="exp">判定式</param>
        public void BeginIf(AdvParamSetting param, ExpressionParser exp)
        {
            isIf      = param.CalcExpressionBoolean(exp);
            isSkpping = !isIf;
        }
Beispiel #11
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="jumpLabel">飛び先のラベル</param>
 /// <param name="text">表示テキスト</param>
 /// <param name="exp">選択時に実行する演算式</param>
 public AdvSelection(string jumpLabel, string text, ExpressionParser exp)
 {
     this.jumpLabel = jumpLabel;
     this.text      = text;
     this.exp       = exp;
 }
		/// <summary>
		/// 選択肢追加
		/// </summary>
		/// <param name="label">ジャンプ先のラベル</param>
		/// <param name="name">クリックを有効にするオブジェクト名</param>
		/// <param name="isPolygon">ポリゴンコライダーを使うか</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public void AddSelectionClick(string label, string name, bool isPolygon, ExpressionParser exp, StringGridRow row)
		{
			AdvSelection select = new AdvSelection(label, name, isPolygon, exp, row);
			spriteSelections.Add(select);
			AddSpriteClickEvent(select);
		}
		/// <summary>
		/// 選択肢追加
		/// </summary>
		/// <param name="label">ジャンプ先のラベル</param>
		/// <param name="text">表示テキスト</param>
		/// <param name="exp">選択時に実行する演算式</param>
		public void AddSelection(string label, string text, ExpressionParser exp, StringGridRow row )
		{
			selections.Add(new AdvSelection(label, text, exp, row));
		}
		//バイナリ読み込み
		void Read(BinaryReader reader, AdvEngine engine)
		{
			int version = reader.ReadInt32();
			if (version == VERSION)
			{
				this.jumpLabel = reader.ReadString();
				this.text = reader.ReadString();
				string expStr = reader.ReadString();
				if (!string.IsNullOrEmpty(expStr))
				{
					this.exp = engine.DataManager.SettingDataManager.DefaultParam.CreateExpression(expStr);
				}
				else
				{
					this.exp = null;
				}
				this.spriteName = reader.ReadString();
				this.isPolygon = reader.ReadBoolean();
			}
			else if (version == VERSION_1)
			{
				this.jumpLabel = reader.ReadString ();
				this.text = reader.ReadString ();
				string expStr = reader.ReadString ();
				if(!string.IsNullOrEmpty(expStr))
				{
					this.exp = engine.DataManager.SettingDataManager.DefaultParam.CreateExpression(expStr);
				}
				else
				{
					this.exp = null;
				}
			}
			else if (version == VERSION_0)
			{
				this.jumpLabel = reader.ReadString ();
				this.text = reader.ReadString ();
			}
			else
			{
				Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
			}
		}
		bool isIf = false;				//if文がtrueになったか

		/// <summary>
		/// if文の開始
		/// </summary>
		/// <param name="param">判定に使う数値パラメーター</param>
		/// <param name="exp">判定式</param>
		public void BeginIf(AdvParamSetting param, ExpressionParser exp)
		{
			isIf = param.CalcExpressionBoolean(exp);
			isSkpping = !isIf;
		}