Esempio n. 1
0
		public PlayerList( Game game, int player )
		{
			this.game = game;
			this.player = (byte)player;

			memory = new Memory( this, 0 );
			
			curCapital = -1; 
			for ( int i = 1; i <= cityNumber; i ++ ) 
				if ( 
					cityList[ i ].state != (byte)enums.cityState.dead && 
					cityList[ i ].isCapitale 
					) 
				{
					curCapital = i;
					break;
				}

			if ( curCapital == -1 )
				for ( int i = 1; i <= cityNumber; i ++ ) 
					if ( cityList[ i ].state != (byte)enums.cityState.dead )
					{
						capital = i; 
						break; 
					}

			slaves = new playerSlavery( this );
			govType = Statistics.governements[ (byte)enums.governements.despotism ];
			invalidateTrade();

			smallWonderList = new WonderList( Statistics.smallWonders.Length );
		}
Esempio n. 2
0
        public PlayerList(Game game, int player)
        {
            this.game   = game;
            this.player = (byte)player;

            memory = new Memory(this, 0);

            curCapital = -1;
            for (int i = 1; i <= cityNumber; i++)
            {
                if (
                    cityList[i].state != (byte)enums.cityState.dead &&
                    cityList[i].isCapitale
                    )
                {
                    curCapital = i;
                    break;
                }
            }

            if (curCapital == -1)
            {
                for (int i = 1; i <= cityNumber; i++)
                {
                    if (cityList[i].state != (byte)enums.cityState.dead)
                    {
                        capital = i;
                        break;
                    }
                }
            }

            slaves  = new playerSlavery(this);
            govType = Statistics.governements[(byte)enums.governements.despotism];
            invalidateTrade();

            smallWonderList = new WonderList(Statistics.smallWonders.Length);
        }
Esempio n. 3
0
        public PlayerList(Game game, byte player, byte civType, string playerName, sbyte prefFood, sbyte prefProd, sbyte prefTrade, sbyte prefScience, sbyte prefHapiness, sbyte prefWealth)
        {
            #region short

            this.game   = game;
            this.player = (byte)player;

            memory = new Memory(this, 0);

            curCapital = -1;
            for (int i = 1; i <= cityNumber; i++)
            {
                if (
                    cityList[i].state != (byte)enums.cityState.dead &&
                    cityList[i].isCapitale
                    )
                {
                    curCapital = i;
                    break;
                }
            }

            if (curCapital == -1)
            {
                for (int i = 1; i <= cityNumber; i++)
                {
                    if (cityList[i].state != (byte)enums.cityState.dead)
                    {
                        capital = i;
                        break;
                    }
                }
            }

            slaves  = new playerSlavery(this);
            govType = Statistics.governements[(byte)enums.governements.despotism];
            invalidateTrade();

            #endregion

            lastSeen = new structures.lastSeen[game.width, game.height];

            this.civType    = civType;
            this.playerName = playerName;
            money           = 0;
            currentResearch = 0;

            unitList        = new UnitList[10];
            cityList        = new CityList[5];
            foreignRelation = new structures.sForeignRelation[game.playerList.Length];

            for (int i = 0; i < game.playerList.Length; i++)
            {
                foreignRelation[i].quality = 100;
                foreignRelation[i].spies   = new xycv_ppc.structures.sSpies[4];

                for (int j = 0; j < 4; j++)
                {
                    foreignRelation[i].spies[j]     = new xycv_ppc.structures.sSpies();
                    foreignRelation[i].spies[j].nbr = 0;
                }
            }

            technos = new xycv_ppc.structures.technoList[Statistics.technologies.Length];

            unitNumber = 0;
            cityNumber = 0;
            technos[0].pntDiscovered = 0;

            preferences.laborFood  = prefFood;
            preferences.laborProd  = prefProd;
            preferences.laborTrade = prefTrade;
            preferences.science    = prefScience;
            preferences.reserve    = prefWealth;
            discovered             = new bool[game.width, game.height];
            see = new bool[game.width, game.height];
            //	p.unitList = new UnitList[ 50 ];
            //	p.foreignRelation = new structures.sForeignRelation[ game.playerList.Length ];

            setResourcesAccess();
            //		p.memory = new Memory( this, 0 );

            smallWonderList = new WonderList(Statistics.smallWonders.Length);
        }
Esempio n. 4
0
		public PlayerList( Game game, byte player, byte civType, string playerName, sbyte prefFood, sbyte prefProd, sbyte prefTrade, sbyte prefScience, sbyte prefHapiness, sbyte prefWealth )
		{
			#region short
			
			this.game = game;
			this.player = (byte)player;

			memory = new Memory( this, 0 );
			
			curCapital = -1; 
			for ( int i = 1; i <= cityNumber; i ++ ) 
				if ( 
					cityList[ i ].state != (byte)enums.cityState.dead && 
					cityList[ i ].isCapitale 
					) 
				{
					curCapital = i;
					break;
				}

			if ( curCapital == -1 )
				for ( int i = 1; i <= cityNumber; i ++ ) 
					if ( cityList[ i ].state != (byte)enums.cityState.dead )
					{
						capital = i; 
						break; 
					}

			slaves = new playerSlavery( this );
			govType = Statistics.governements[ (byte)enums.governements.despotism ];
			invalidateTrade();

			#endregion

			lastSeen = new structures.lastSeen[ game.width, game.height ];

			this.civType = civType;
			this.playerName = playerName;
			money = 0;
			currentResearch = 0;

			unitList = new UnitList[ 10 ];
			cityList = new CityList[ 5 ];
			foreignRelation = new structures.sForeignRelation[ game.playerList.Length ];

			for ( int i = 0; i < game.playerList.Length; i ++ )
			{
				foreignRelation[ i ].quality = 100;
				foreignRelation[ i ].spies = new xycv_ppc.structures.sSpies[ 4 ];
				
				for ( int j = 0; j < 4; j ++ )
				{
					foreignRelation[ i ].spies[ j ] = new xycv_ppc.structures.sSpies();
					foreignRelation[ i ].spies[ j ].nbr = 0;
				}
			}
	
			technos = new xycv_ppc.structures.technoList[ Statistics.technologies.Length ];

			unitNumber = 0;
			cityNumber = 0;
			technos[ 0 ].pntDiscovered = 0;
			
			preferences.laborFood = prefFood;
			preferences.laborProd = prefProd;
			preferences.laborTrade = prefTrade;
			preferences.science = prefScience;
			preferences.reserve = prefWealth;
			discovered = new bool[ game.width, game.height ];
			see = new bool[ game.width, game.height ];
			//	p.unitList = new UnitList[ 50 ];
			//	p.foreignRelation = new structures.sForeignRelation[ game.playerList.Length ];
			
			setResourcesAccess();
			//		p.memory = new Memory( this, 0 );

			smallWonderList = new WonderList( Statistics.smallWonders.Length );
		}