/***********************************************************************
*Copyright (c)2012 , 天际边工作室
*All rights reserved.
**
文件名称：	GameMap.h
*摘要：		游戏主地图类头文件
**
*修改历史：
*	版本    日期     作者     改动内容和原因
*   ----------------------------------------------------
*	1.0    2012-10-5  wstjb     基本的功能完成
***********************************************************************/

#pragma once

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include "PublicFun.h"
#include "Menu.h"
#include "Date.h"
#include "Head.h"
#include "Country.h"
#include "CityList.h"
#include "HeroList.h"
#include "GoodList.h"
#include "Operate.h"
#include "TaskList.h"
#include "Save.h"
#include "Fight.h"

class GameMap
{

public:
	void InitMap(int num,int uchoice);
	int KeyDown(WPARAM KeyCode);
	void Show(WPARAM KeyCode);

	void ArrowSet();
	void GetCityName();
	void ShowCityIcon(int tmp);
	int GetOrder(int x);
	void ShowIt(int fa,int in,int x);
	void DeleteHero();
	int GetCityNum();
	int ArriveEnable();
	void ShowEnd();
	void GetCityPrefect();
	int IsCity();
	void AddMoney();
	void AddFood();
	void DoEndEvent();
	void HeroUpdate();
	void CityUpdate();
	void GetCityState();
	void ReportCityState(int c,int statue,int ownto);
	void ComputerStatic();
	void ComputerTacticInterior(int c);//内政
	void ComputerTacticHarmonize(int c);//、协调
	void ComputerTacticDiplomatism(int c);//外交
	void ComputerTacticArmament(int c);//军备
	void TaskListRun();
	void WarRun();
	void ShowItAfter(int event,int result,int data,int heronum);
	void ChangeOwnerNum();
	int GetCityPostion(int pox,int poy,int choice,int num);
	int IsWinOrLose();
	void ShowItAfterWar(int result,int hero1,int hero2,int city);
	void ChangeDataToSave();
	int GetEnemyCity(int g);
	int AutoBattle(int soldier,int foods,int soldierto,int foodsto);
	void AfterWar(int result,int city1,int city2);
	void SetFightHeroData(int i);
	void SetFightHeroData2(int i);
	void SetForce();
	int GetClever(int ya);
	int BeCapatured(int num,int cityto);
	int GetCaptive(int num,int cityto);
	int GetUnx(int my_tpcity);
	int GetUny(int my_tpcity);
	void AfterWar_SpaceCity(int a,int city1,int city2,int io);
	void AfterWar_Auto(int retauto,int city1,int city2,int heronum,int heronumto);
	int BeCapatured_Auto(int num,int cityto,int tmp_ownernum);
	int GetCaptive_Auto(int num,int cityto,int tmp_ownernum);
	void CheckWin();
	void DelTimeEvent();
	void HeroCheck(int i);
	int SelectHeroForDefense(WPARAM KeyCode);
	int ChangeOwner(WPARAM KeyCode);
	int DelOperateList(WPARAM KeyCode);
	int DelGoodList(WPARAM KeyCode);
	int ExecHeroList_Twice(WPARAM KeyCode);
	int ExecHeroList_Once(WPARAM KeyCode);
	int DelHeroList_Interior(WPARAM KeyCode);//内政
	int DelHeroList_Diplomatism(WPARAM KeyCode);//外交
	int DelHeroList_Armament(WPARAM KeyCode);//军备
	int DelEscMenu(WPARAM KeyCode);
	int DelCityMenu(WPARAM KeyCode);//城市主菜单
	int GetCityInfo(WPARAM KeyCode);
	int CheckIfCity(WPARAM KeyCode);//城市位置判断及功能
	int CheckIfHeroListCanShow();
	int DelMainScenceEsc(WPARAM KeyCode);
	int Order_Reclaim(int x);//开垦
	int Order_Investment(int x);//招商
	int Order_Search(int x);//搜寻
	int Order_Govern(int x);//治理
	int Order_Tour(int x);//出巡
	int Order_Surrender(int x);//招降
	int Order_Behead(int x);//处斩
	int Order_Exile(int x);//流放
	int Order_Award(int x);//赏赐
	int Order_Confiscate(int x);//没收
	int Order_Trade(int x);//交易
	int Order_Banquet(int x);//宴请
	int Order_Transport(int x);//输送
	int Order_Move(int x);//移动
	int Order_Alienate(int x);//离间
	int Order_Solicit(int x);//招揽
	int Order_Instigation(int x);//策反
	int Order_Anti(int x);//反间
	int Order_Capitulate(int x);//劝降
	int Order_Scout(int x);//侦察
	int Order_Conscription(int x);//征兵
	int Order_Allocation(int x);//分配
	int Order_Plunder(int x);//掠夺
	int Order_Expedition(int x);//出征
	int DelCaptureGood(int num,int cityto);//处理俘虏道具
	int currentcitynum;
	int statc;
	int unx;
	int uny;
	int arrowx;
	int arrowy;
	int zbx;
	int zby;
	int flagl;//左
	int flagr;//右
	int flagu;//上
	int flagd;//下
	int ngc;
	int unum;
	int unum2;
	int flagmap1;
	int flagmap2;
	int ngsecond1;
	int ngsecond2;
	int ngthird1;
	int ngthird2;
	int ngthird3;
	int ngthird4;
	int ngsave;
	int flagwar;
	int flagmap11;
	int flagmap12;
	int flagmap13;
	int choice;
	int citynumber;
	int heronumber;
	int ownernum;
	Menu escmenu;
	Menu citymenu;
	Menu secondmenu1;
	Menu secondmenu2;
	Menu secondmenu3;
	Date date;
	Head head;
	CityList citylist;
	Country country;
	HeroList herolist;
	GoodList goodlist;
	Operate operate;
	TaskList tasklist[TASKLISTMAX];
	Save save;
	Fight fight;
	int my_warherono[10];
	int my_warherononum;
	int flagx;
	int emperorid[4][20];//君主ID
};