public StationFactory(Player player, ContentManager content, float dX, float dY) { Player = player; Content = content; DX = dX; DY = dY; }
public ShipFactory(Player player, ContentManager content, float dX, float dY) { Player = player; Content = content; DX = dX; DY = dY; Circle = Content.Load<Texture2D>("Ships/OnOverCircle"); HPBar = Content.Load<Texture2D>("UI/Lines/GreenLine"); ShieldBar = Content.Load<Texture2D>("UI/Lines/BlueLine"); }
//--------------------------------------------------------------- //START GAME BUTTON CLICK //--------------------------------------------------------------- private void StartGameBtnClick(object sender, MouseState ms) { if (((TextBox)screens["Choose"].Objects["RaceName"]).Content == "") { return; } UnloadEvents("Choose"); int damage, defence, speed, science, product; try { damage = Int32.Parse(((GameString)screens["Choose"].Objects["DamageString"]).Str); defence = Int32.Parse(((GameString)screens["Choose"].Objects["DefenceString"]).Str); speed = Int32.Parse(((GameString)screens["Choose"].Objects["SpeedString"]).Str); science = Int32.Parse(((GameString)screens["Choose"].Objects["ScienceString"]).Str); product = Int32.Parse(((GameString)screens["Choose"].Objects["ProductString"]).Str); } catch { return; } Race race = new Race(((TextBox)screens["Choose"].Objects["RaceName"]).Content, damage, defence, speed, science, product); Player player = new Player(ConstructPlayerName(), race); //Создание фабрики кораблей для данного игрока. ShipCreator = new ShipFactory(player, Content, scaleX, scaleY); StationCreator = new StationFactory(player, Content, scaleX, scaleY); currentPlayer = player.Name; players.Add(player.Name, player); CreateGen(); currentScreen = "Gen"; Thread t = new Thread(WorldGenerator); t.Start(); }