• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SIMONFramework.SIMONObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SIMONFramework.SIMONObject的典型用法代码示例。如果您正苦于以下问题:C# SIMONObject类的具体用法?C# SIMONObject怎么用?C# SIMONObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SIMONObject类属于SIMONFramework命名空间,在下文中一共展示了SIMONObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CopyToObject

 private SIMONObject CopyToObject()
 {
     SIMONObject newObject = new SIMONObject();
     newObject.ObjectID = this.ObjectID;
     newObject.Properties = this.Properties;
     newObject.Actions = this.Actions;
     return newObject;
 }
开发者ID:notear0,项目名称:SIMONFramework,代码行数:8,代码来源:SIMONObject.cs


示例2: SerializeObject

 public void SerializeObject(string filePath, SIMONObject sObject)
 {
     if (sObject == null)
         return;
     XmlSerializer serializer = new XmlSerializer(typeof(SIMONObject));
     string fullPath = Directory.GetCurrentDirectory() + SIMONConstants.API_DEFINITION_PATH + filePath;
     string dirPath = Path.GetDirectoryName(fullPath);
     if (!Directory.Exists(dirPath))
         Directory.CreateDirectory(dirPath);
     FileStream fStream = new FileStream(fullPath, FileMode.Create);
     StreamWriter sWriter = new StreamWriter(fStream, System.Text.Encoding.UTF8);
     if (fStream.CanWrite)
         serializer.Serialize(sWriter, sObject);
     fStream.Close();
 }
开发者ID:notear0,项目名称:SIMONFramework,代码行数:15,代码来源:SIMONUtility.cs


示例3: MoveSimulationScene

	IEnumerator MoveSimulationScene()
	{
		Sound_Btn_Click.GetComponent<AudioSource> ().Play ();
		yield return new WaitForSeconds(0.7f); 

		if(SceneManager.SceneMode == 1)
			SceneManager.SM.changeAndMoveScene(SceneState.scene_setting_property);
		else if(SceneManager.SceneMode == 2)
			SceneManager.SM.changeAndMoveScene(SceneState.scene_play_simulation);
		else if(SceneManager.SceneMode == 3)
		{
			SIMONObject sObject;
			SIMONObject sObjectB;
			for(int i = 1; i < 8 ; i++)
			{
				sObject = new SIMONObject ();
				sObjectB = new SIMONObject();
				sObject.ObjectID = "Monster_A_"+i.ToString();
				GameTimeManager_Compare.GroupA.Add (sObject.ObjectID, sObject);
				sObjectB.ObjectID = "Monster_B_"+i.ToString();
				GameTimeManager_Compare.GroupB.Add (sObject.ObjectID, sObjectB);
			}
			for (int i = 0; i< GameTimeManager_Compare.GroupB.Count; i++) 
			{
				if(SceneManager.SimulationType == 1)
				{
					((SIMONObject)GameTimeManager_Compare.GroupB.ValueOfIndex (i)).LoadObjectDefinition("PlayGame\\State_property_"+SceneManager.PlayGame_State.ToString(),((SIMONObject)GameTimeManager_Compare.GroupB.ValueOfIndex (i)).ObjectID);
					
					((SIMONObject)GameTimeManager_Compare.GroupA.ValueOfIndex (i)).LoadObjectDefinition("PlayGame\\State_property_"+SceneManager.PlayGame_State.ToString(),((SIMONObject)GameTimeManager_Compare.GroupA.ValueOfIndex (i)).ObjectID);
				}
				else
				{
					((SIMONObject)GameTimeManager_Compare.GroupB.ValueOfIndex (i)).LoadObjectDefinition("PlayGame\\State_action_"+SceneManager.PlayGame_State.ToString(),((SIMONObject)GameTimeManager_Compare.GroupB.ValueOfIndex (i)).ObjectID);
					
					((SIMONObject)GameTimeManager_Compare.GroupA.ValueOfIndex (i)).LoadObjectDefinition("PlayGame\\State_action_"+SceneManager.PlayGame_State.ToString(),((SIMONObject)GameTimeManager_Compare.GroupA.ValueOfIndex (i)).ObjectID);
				}
			}

			SceneManager.SM.changeAndMoveScene(SceneState.scene_play_compare);
		}
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:41,代码来源:ChoiceSceneTypeScript.cs


示例4: ActionFunction_Skill_Range

	public System.Object ActionFunction_Skill_Range(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") +
			a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4");
		double tempValue = 0.0d;
		
		double geneA, geneB, geneC , geneD;
		
		if (a.GetPropertyElement ("Range") < 20)
			return MaxValue;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_7")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_7",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		
		
		if(SimulationType == 1)
		{
			geneA = -48.0d;
			geneB = 22.0d;
			geneC = 24.0d;
			geneD = 176.0d;
		}
		else
		{
			geneA = a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_A");
			geneB =	a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_B");
			geneC = a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_C");
			geneD = a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_D");
		}
		
		if (a.GetPropertyElement ("Range") < 20)
			return MaxValue;
		
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_7")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_7",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					tempValue =((scoreConversion(-25.0d,Total_Enemy)*geneA)
					            )*4.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:61,代码来源:SIMON_Controller.cs


示例5: ActionFunction_Skill_Defensive

	public System.Object ActionFunction_Skill_Defensive(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double tempValue = 0.0d;	
		double hp =a.GetPropertyElement("CurHp");
		double total_hp = a.GetPropertyElement ("HP");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		
		double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") +
			a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4");
		
		double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") +
			a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4");
		
		double geneA, geneB, geneC , geneD;


		if (a.GetPropertyElement ("Defensive") < 20)
			return MaxValue;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_5")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_5",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		
		
		
		if(SimulationType == 1)
		{
			geneA = 400.0d;
			geneB = -1.0d;
			geneC = 6.0d;
			geneD = 5.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_A");
			geneB =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_B");
			geneC =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_C");
			geneD =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_D");
		}
		
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_5")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_5",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+
					            (scoreConversion(25.0d,Total_Home)*geneB)+
					            (scoreConversion(25.0d,Total_Enemy)*geneD)+
					            (scoreConversion(25.0d,attackedCount)*geneC)
					            )*2.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:70,代码来源:SIMON_Controller.cs


示例6: PropertyUpdate

	public System.Object PropertyUpdate(SIMONObject a, SIMONObject[] b)
	{
		GameObject myObject;
		myObject = GameObject.Find (a.ObjectID);
		int count = 0, count_H1 = 0, count_H2 = 0, count_H3=0,count_H4=0;
		int count_E1 = 0, count_E2 = 0, count_E3=0,count_E4=0;
		double positionX = 0.0d;
		double positionY = 0.0d;
		double myPositionX = myObject.transform.position.x;
		double myPositionY = myObject.transform.position.y;
		double disX, disY;
		Vector2 p;
		float distance;
		if(a.GetPropertyElement("Type") == 2)
		{
			if (myObject.GetComponent<SIMON_Controller>().animator.GetCurrentAnimatorStateInfo (0).IsTag ("Stay")) 
			{
				a.SetPropertyElement("isCheck",1);
			}
		}
		else
		{
			if (myObject.GetComponent<UsualAI_Controller>().animator.GetCurrentAnimatorStateInfo (0).IsTag ("Stay")) 
			{
				a.SetPropertyElement("isCheck",1);
			}
		}
		a.SetPropertyElement ("PositionX", (double)myObject.transform.position.x);
		a.SetPropertyElement ("PositionY", (double)myObject.transform.position.y);
		
		for(int i = 0; i < b.Length; i++)
		{
			if(b[i].GetPropertyElement ("CurHp") <= 0)
			{
				continue;
			}
			
			if(b[i].GetPropertyElement ("Attack_Target")== a.GetPropertyElement("ID"))
			{
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
					count++;
			}
			positionX = b[i].GetPropertyElement ("PositionX");
			positionY = b[i].GetPropertyElement ("PositionY");
			p = new Vector2((float)positionX,(float)positionY);
			
			distance = Vector2.Distance(p,myObject.transform.position);
			
			if(distance < a.GetPropertyElement("Monster_Sight"))
			{
				disX = positionX - myPositionX;
				disY = positionY - myPositionY;
				if(disX > 0 && disY > 0)
				{
					if(disY - disX > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H1++;
						else
							count_E1++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H4++;
						else
							count_E4++;
					}
					
				}
				else if(disX < 0 && disY > 0)
				{
					if(disY - (disX * -1.0d) > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H1++;
						else
							count_E1++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H2++;
						else
							count_E2++;
					}
				}
				else if(disX < 0 && disY < 0)
				{
					if((disY * -1.0d) - (disX * -1.0d) > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H3++;
						else
							count_E3++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H2++;
//.........这里部分代码省略.........
开发者ID:notear0,项目名称:SIMONFramework,代码行数:101,代码来源:SIMON_Controller.cs


示例7: FitnessFunction_Avoid

	public System.Object FitnessFunction_Avoid(SIMONObject a, SIMONObject[] b)
	{		
		double value=100.0d;
		value = -1.0d * a.GetPropertyElement("Monster_Total_AttackedCount");
		return value;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:6,代码来源:SIMON_Controller.cs


示例8: PropertyUpdate_FitnessFunction

	public System.Object PropertyUpdate_FitnessFunction(SIMONObject a, SIMONObject[] b)
	{
		double value ;
		value =-10000000.0d;
		return value;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:6,代码来源:SIMON_Controller.cs


示例9: Monster_defense

	public Object Monster_defense(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("State", (double)3.0d);
		a.SetPropertyElement ("Attack_Target", -1.0d);
		a.SetPropertyElement ("Move_Target", -1.0d);
		a.SetPropertyElement ("Target",-1.0d);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:8,代码来源:SIMON_Controller.cs


示例10: InsertSIMONObject

	public void InsertSIMONObject(string key, SIMONObject sObject){
		SimonManager.RegisterSIMONObject (key, sObject);
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:3,代码来源:SIMONUnity.cs


示例11: PublishDefinition

	public void PublishDefinition(string fileName, SIMONObject source){
		SimonManager.PublishObject (fileName, source);
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:3,代码来源:SIMONUnity.cs


示例12: BeginMethod

 /// <summary>
 /// methodName을 이름으로 하는 SimonFunction에 등록된 함수에 대한 비동기 작업을 수행합니다.
 /// </summary>
 /// <param name="methodName">함수 이름입니다.</param>
 /// <param name="thisObject">함수에 전달할 주체 Parameter입니다.</param>
 /// <param name="theOtherObjects">함수에 전달할 객체 Parameter 배열입니다.</param>
 /// <returns>함수 실행에 대한 비동기 결과.</returns>
 public IAsyncResult BeginMethod(string methodName, SIMONObject thisObject, SIMONObject[] theOtherObjects)
 {
     IAsyncResult result = SimonFunctions[methodName].BeginInvoke(thisObject, theOtherObjects, null, null);
     return result;
 }
开发者ID:notear0,项目名称:SIMONFramework,代码行数:12,代码来源:SIMONManager.cs


示例13: RunMethod

 /// <summary>
 /// methodName을 이름으로 하는 SimonFunction에 등록된 함수를 실행합니다.
 /// </summary>
 /// <param name="methodName">실행할 함수의 이름입니다.</param>
 /// <param name="thisObject">함수에 전달할 주체 Parameter입니다.</param>
 /// <param name="theOtherObjects">함수에 전달할 객체 Parameter배열입니다.</param>
 /// <returns>함수의 결과값입니다.</returns>
 public Object RunMethod(string methodName, SIMONObject thisObject, SIMONObject[] theOtherObjects)
 {
     return SimonFunctions[methodName].Invoke(thisObject, theOtherObjects);
 }
开发者ID:notear0,项目名称:SIMONFramework,代码行数:11,代码来源:SIMONManager.cs


示例14: monster_Skill_Defensive

	public Object monster_Skill_Defensive(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 5);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:5,代码来源:SIMON_Controller.cs


示例15: monster_Skill_Range

	public Object monster_Skill_Range(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 7);
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:5,代码来源:SIMON_Controller.cs


示例16: DeleteSIMONObject

	public void DeleteSIMONObject(SIMONObject sObject){
		SimonManager.UnregisterSIMONObject (sObject);
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:3,代码来源:SIMONUnity.cs


示例17: Monster_attack

	public Object Monster_attack(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement("State",2.0d);
		a.SetPropertyElement ("Move_Target", -1.0d);
		a.SetPropertyElement("Target",a.GetPropertyElement("Attack_Target"));
		return null;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:7,代码来源:SIMON_Controller.cs


示例18: Start

	// Use this for initialization
	void Start () 
	{
		gObj_Monster = this.gameObject;
		animator = GetComponent<Animator> ();
		SimulationType = SceneManager.SimulationType;

		sObject = new SIMONObject ();
		
		sObject.ObjectID = gObj_Monster.name;
		
		if (GameTimeManager_Compare.GroupA.Count == 7) 
		{
			for(int i= 0 ; i < GameTimeManager_Compare.GroupA.Count ; i++)
			{
				if(((SIMONObject)GameTimeManager_Compare.GroupA.ValueOfIndex (i)).ObjectID.Equals(sObject.ObjectID))
				{
					sObject = ((SIMONObject)GameTimeManager_Compare.GroupA.ValueOfIndex (i));
					reStart();
					if(SceneManager.PlayGame_State >1)
						return;
					break;
					
				}
			}
		}
		
		SIMON.GlobalSIMON.InsertSIMONObject(sObject);
		
		
		SIMONFunction propertyUpdate_Name = PropertyUpdate;
		SIMONFunction ExecutionFunction_propertyUpdate_Name = PropertyUpdate_Exection;
		SIMONFunction FitnessFunction_propertyUpdate_Name = PropertyUpdate_FitnessFunction;
		
		SIMONFunction ActionFunction_Move_Name = ActionFunction_Move;
		SIMONFunction ExecutionFunction_Move_Name = Monster_move;
		SIMONFunction FitnessFunction_Move_Name = FitnessFunction_Move;
		
		SIMONFunction ActionFunction_Attack_Name = ActionFunction_Attack;
		SIMONFunction ExecutionFunction_Attack_Name = Monster_attack;
		SIMONFunction FitnessFunction_Attack_Name = FitnessFunction_Attack;
		
		SIMONFunction ActionFunction_Defense_Name = ActionFunction_Defense;
		SIMONFunction ExecutionFunction_Defense_Name = Monster_defense;
		SIMONFunction FitnessFunction_Defense_Name = FitnessFunction_Defense;
		
		SIMONFunction ActionFunction_Avoid_Name = ActionFunction_Avoid;
		SIMONFunction ExecutionFunction_Avoid_Name = Monster_avoid;
		SIMONFunction FitnessFunction_Avoid_Name = FitnessFunction_Avoid;
		//
		
		SIMONFunction ActionFunction_Skill_Strength_Name = ActionFunction_Skill_Strength;
		SIMONFunction ExecutionFunction_Skill_Strength_Name = monster_Skill_Strength;
		SIMONFunction FitnessFunction_Skill_Strength_Name = FitnessFunction_Skill_Strength;
		
		SIMONFunction ActionFunction_Skill_Attack_Speed_Name = ActionFunction_Skill_Attack_Speed;
		SIMONFunction ExecutionFunction_Skill_Skill_Attack_Speed_Name = monster_Skill_Attack_Speed;
		SIMONFunction FitnessFunction_Skill_Attack_Speed_Name = FitnessFunction_Skill_Attack_Speed;
		
		SIMONFunction ActionFunction_Skill_Moving_Speed_Name = ActionFunction_Skill_Moving_Speed;
		SIMONFunction ExecutionFunction_Skill_Skill_Moving_Speed_Name = monster_Skill_Moving_Speed;
		SIMONFunction FitnessFunction_Skill_Moving_Speed_Name = FitnessFunction_Skill_Moving_Speed;
		
		SIMONFunction ActionFunction_Skill_Critical_Name = ActionFunction_Skill_Critical;
		SIMONFunction ExecutionFunction_Skill_Skill_Critical_Name = monster_Skill_Critical;
		SIMONFunction FitnessFunction_Skill_Critical_Name = FitnessFunction_Skill_Critical;
		
		SIMONFunction ActionFunction_Skill_Defensive_Name = ActionFunction_Skill_Defensive;
		SIMONFunction ExecutionFunction_Skill_Skill_Defensive_Name = monster_Skill_Defensive;
		SIMONFunction FitnessFunction_Skill_Defensive_Name = FitnessFunction_Skill_Defensive;
		
		SIMONFunction ActionFunction_Skill_CON_Name = ActionFunction_Skill_CON;
		SIMONFunction ExecutionFunction_Skill_Skill_CON_Name = monster_Skill_CON;
		SIMONFunction FitnessFunction_Skill_CON_Name = FitnessFunction_Skill_CON;
		
		SIMONFunction ActionFunction_Skill_Range_Name = ActionFunction_Skill_Range;
		SIMONFunction ExecutionFunction_Skill_Skill_Range_Name = monster_Skill_Range;
		SIMONFunction FitnessFunction_Skill_Range_Name = FitnessFunction_Skill_Range;
		
		//
		
		SIMON.GlobalSIMON.InsertSIMONMethod("propertyUpdate", propertyUpdate_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("Execution_propertyUpdate" , ExecutionFunction_propertyUpdate_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_propertyUpdate" , FitnessFunction_propertyUpdate_Name);
		
		SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Move" , ActionFunction_Move_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Move" , ExecutionFunction_Move_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Move" , FitnessFunction_Move_Name);
		
		SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Attack" , ActionFunction_Attack_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Attack" , ExecutionFunction_Attack_Name);		
		SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Attack" , FitnessFunction_Attack_Name);
		
		SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Defense" , ActionFunction_Defense_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Defense" , ExecutionFunction_Defense_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Defense" , FitnessFunction_Defense_Name);
		
		SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Avoid" , ActionFunction_Avoid_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Avoid" , ExecutionFunction_Avoid_Name);
		SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Avoid" , FitnessFunction_Avoid_Name);
//.........这里部分代码省略.........
开发者ID:notear0,项目名称:SIMONFramework,代码行数:101,代码来源:SIMON_Controller.cs


示例19: FitnessFunction_Attack

	public System.Object FitnessFunction_Attack(SIMONObject a, SIMONObject[] b)
	{
		double value;
		value = a.GetPropertyElement("Monster_Total_Damage")/a.GetPropertyElement("Monster_Total_AttackCount");
		return value;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:6,代码来源:SIMON_Controller.cs


示例20: ActionFunction_Defense

	public System.Object ActionFunction_Defense(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double tempValue = 0.0d;	
		double hp =a.GetPropertyElement("CurHp");
		double total_hp = a.GetPropertyElement ("HP");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		
		double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") +
			a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4");
		
		double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") +
			a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4");
		
		double geneA, geneB, geneD;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (a.GetPropertyElement ("HP") / 2 > a.GetPropertyElement ("CurHp"))
			{
				MaxValue = Random.Range(100,200);
			}
			
			return MaxValue;
		}
		
		
		if(SimulationType == 1)
		{
			geneA = 80.0d;
			geneB = -17.0d;
			geneD = -9.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Defense").FindWeight ("Defense_Gene_A");
			geneB = a.GetActionObject("Defense").FindWeight ("Defense_Gene_B");
			geneD = a.GetActionObject("Defense").FindWeight ("Defense_Gene_D");
		}
		
		if (a.GetPropertyElement ("AttackedCount") == 0) 
		{
			return MaxValue;
		}
		if (a.GetPropertyElement ("HP") == hp) 
		{
			return MaxValue;
		}
		for(int i = 0 ; i < b.Length ; i++)
		{
			if(b[i].GetPropertyElement("CurHp") <=0)
				continue;
			if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
			{
				tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+
				            (scoreConversion(25.0d,Total_Home)*geneB)+
				            (scoreConversion(25.0d,Total_Enemy)*geneD)
				            );
				if(MaxValue < tempValue)
				{
					MaxValue = tempValue;
				}
			}
		}
		return MaxValue;
	}
开发者ID:notear0,项目名称:SIMONFramework,代码行数:66,代码来源:SIMON_Controller.cs



注:本文中的SIMONFramework.SIMONObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SIP.UserAgent类代码示例发布时间:2022-05-26
下一篇:
C# Wizards.WizardArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap