private void HandleMessage(Contact contact, MessageType message, Empire whichEmpire)
{
switch (message)
{
case MessageType.ACCEPT_ALLIANCE:
{
contact.Allied = true;
contact.ModifyRelationship(20);
} break;
case MessageType.ACCEPT_NONAGGRESSION:
{
contact.NonAggression = true;
contact.ModifyRelationship(10);
} break;
case MessageType.ACCEPT_TRADE:
{
contact.TradeTreaty = true;
contact.TradePercentage = -5;
contact.ModifyRelationship(5);
} break;
case MessageType.ACCEPT_RESEARCH:
{
contact.ResearchTreaty = true;
contact.ResearchPercentage = -5;
contact.ModifyRelationship(5);
} break;
case MessageType.BREAK_ALLIANCE:
{
contact.Allied = false;
contact.ModifyRelationship(-30);
} break;
case MessageType.BREAK_NONAGGRESSION:
{
contact.NonAggression = false;
contact.ModifyRelationship(-20);
} break;
case MessageType.BREAK_RESEARCH:
{
contact.ResearchTreaty = false;
contact.ResearchPercentage = 0;
contact.ModifyRelationship(-10);
} break;
case MessageType.BREAK_TRADE:
{
contact.TradeTreaty = false;
contact.TradePercentage = 0;
contact.ModifyRelationship(-10);
} break;
case MessageType.DECLINE_REQUEST:
{
contact.ModifyRelationship(-5);
} break;
case MessageType.WAR:
{
contact.AtWar = true;
contact.ModifyRelationship(-75);
} break;
case MessageType.ACCEPT_PEACE:
{
contact.AtWar = false;
contact.ModifyRelationship(15);
} break;
case MessageType.ACCEPT_RECONCILE:
{
foreach (Contact whichContact in contact.EmpireInContact.ContactManager.Contacts)
{
if (whichContact.EmpireInContact == whichEmpire)
{
whichContact.ModifyRelationship(10);
return;
}
}
} break;
case MessageType.ACCEPT_HARASS:
{
foreach (Contact whichContact in contact.EmpireInContact.ContactManager.Contacts)
{
if (whichContact.EmpireInContact == whichEmpire)
{
whichContact.ModifyRelationship(-15);
return;
}
}
} break;
}
}