[Freeciv-Dev] Diplomacy in general
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hello,
I have started a patch. The aim of this patch is what all
comparaisons of ownership between cities,units and players will
be handle by 3 functions :
is_enemy_player
-> return player1->player_no != player2->player_no
is_friendly_player
-> return player1->player_no == player2->player_no
is_same_player
-> return player1->player_no == player2->player_no
After, I finished my patch. All the part where an 'ownership' test is done
will be resolved by one of this 3 functions.
For example, you can add an array relation_ship_between(,).
with 3 kinds of relationship :
- TRUSTED ALLY
- PEACE
- WAR
For is_same_player
return relation_ship_between(player1,player2) == TRUSTED_ally
For is_friendly_player
return relation_ship_between(player1,player2) == PEACE
for is_enemy_player
return relation_ship_between(player1,player2) == WAR
Add a clause in the diplomatic treaty and its done.
I created is_same_player so that player can use other people units,
benefit from trusted allies wonders and so one.
I hope no one lese is working on a similar patch.
If so, mail me.
Best regards,
|
|