Exemple #1
0
public void Start()
	{
		System.Int32 ___AmountOfPlayers00;
		___AmountOfPlayers00 = UnityMenu.AmountOfPlayers;
		GameConstants ___constants00;
		___constants00 = new GameConstants();
		System.Collections.Generic.List<UnityPlanet> ___unityPlanets00;
		___unityPlanets00 = UnityPlanet.FindAllPlanets(___AmountOfPlayers00);
		System.Collections.Generic.List<UnityLink> ___unityLinks00;
		___unityLinks00 = UnityLink.FindLinks();
		System.Collections.Generic.List<UnityStarSystem> ___unityStarSystem00;
		___unityStarSystem00 = UnityStarSystem.FindAllStarSystems();
		UnityRouting.findRouter(___unityPlanets00,___unityLinks00);
		Faction ___Types00;
		___Types00 = ___constants00.Aggressive;
		List<Commander> ___commanders00;
		___commanders00 = (

(Enumerable.Range(1,(1) + ((___AmountOfPlayers00) - (1))).ToList<System.Int32>()).Select(__ContextSymbol15 => new { ___a01 = __ContextSymbol15 })
.Select(__ContextSymbol16 => new Commander(__ContextSymbol16.___a01,___Types00))
.ToList<Commander>()).ToList<Commander>();
		List<System.Single> ___MinPlanetPositionX00;
		___MinPlanetPositionX00 = (

(___unityPlanets00).Select(__ContextSymbol17 => new { ___p01 = __ContextSymbol17 })
.Select(__ContextSymbol18 => new {___other00 = (

(___unityPlanets00).Select(__ContextSymbol19 => new { ___p100 = __ContextSymbol19,prev = __ContextSymbol18 })
.Where(__ContextSymbol20 => ((((__ContextSymbol20.prev.___p01.Position.x) > (__ContextSymbol20.___p100.Position.x))) && (!(((__ContextSymbol20.prev.___p01) == (__ContextSymbol20.___p100))))))
.Select(__ContextSymbol21 => __ContextSymbol21.___p100)
.ToList<UnityPlanet>()).ToList<UnityPlanet>(), prev = __ContextSymbol18 })
.Where(__ContextSymbol22 => ((__ContextSymbol22.___other00.Count) == (0)))
.Select(__ContextSymbol23 => __ContextSymbol23.prev.___p01.Position.x)
.ToList<System.Single>()).ToList<System.Single>();
		List<System.Single> ___MinPlanetPositionY00;
		___MinPlanetPositionY00 = (

(___unityPlanets00).Select(__ContextSymbol24 => new { ___p02 = __ContextSymbol24 })
.Select(__ContextSymbol25 => new {___other01 = (

(___unityPlanets00).Select(__ContextSymbol26 => new { ___p101 = __ContextSymbol26,prev = __ContextSymbol25 })
.Where(__ContextSymbol27 => ((((__ContextSymbol27.prev.___p02.Position.y) > (__ContextSymbol27.___p101.Position.y))) && (!(((__ContextSymbol27.prev.___p02) == (__ContextSymbol27.___p101))))))
.Select(__ContextSymbol28 => __ContextSymbol28.___p101)
.ToList<UnityPlanet>()).ToList<UnityPlanet>(), prev = __ContextSymbol25 })
.Where(__ContextSymbol29 => ((__ContextSymbol29.___other01.Count) == (0)))
.Select(__ContextSymbol30 => __ContextSymbol30.prev.___p02.Position.y)
.ToList<System.Single>()).ToList<System.Single>();
		List<System.Single> ___MinPlanetPositionZ00;
		___MinPlanetPositionZ00 = (

(___unityPlanets00).Select(__ContextSymbol31 => new { ___p03 = __ContextSymbol31 })
.Select(__ContextSymbol32 => new {___other02 = (

(___unityPlanets00).Select(__ContextSymbol33 => new { ___p102 = __ContextSymbol33,prev = __ContextSymbol32 })
.Where(__ContextSymbol34 => ((((__ContextSymbol34.prev.___p03.Position.z) > (__ContextSymbol34.___p102.Position.z))) && (!(((__ContextSymbol34.prev.___p03) == (__ContextSymbol34.___p102))))))
.Select(__ContextSymbol35 => __ContextSymbol35.___p102)
.ToList<UnityPlanet>()).ToList<UnityPlanet>(), prev = __ContextSymbol32 })
.Where(__ContextSymbol36 => ((__ContextSymbol36.___other02.Count) == (0)))
.Select(__ContextSymbol37 => __ContextSymbol37.prev.___p03.Position.z)
.ToList<System.Single>()).ToList<System.Single>();
		List<System.Single> ___MaxPlanetPositionX00;
		___MaxPlanetPositionX00 = (

(___unityPlanets00).Select(__ContextSymbol38 => new { ___p04 = __ContextSymbol38 })
.Select(__ContextSymbol39 => new {___other03 = (

(___unityPlanets00).Select(__ContextSymbol40 => new { ___p103 = __ContextSymbol40,prev = __ContextSymbol39 })
.Where(__ContextSymbol41 => ((((__ContextSymbol41.___p103.Position.x) > (__ContextSymbol41.prev.___p04.Position.x))) && (!(((__ContextSymbol41.prev.___p04) == (__ContextSymbol41.___p103))))))
.Select(__ContextSymbol42 => __ContextSymbol42.___p103)
.ToList<UnityPlanet>()).ToList<UnityPlanet>(), prev = __ContextSymbol39 })
.Where(__ContextSymbol43 => ((__ContextSymbol43.___other03.Count) == (0)))
.Select(__ContextSymbol44 => __ContextSymbol44.prev.___p04.Position.x)
.ToList<System.Single>()).ToList<System.Single>();
		List<System.Single> ___MaxPlanetPositionZ00;
		___MaxPlanetPositionZ00 = (

(___unityPlanets00).Select(__ContextSymbol45 => new { ___p05 = __ContextSymbol45 })
.Select(__ContextSymbol46 => new {___other04 = (

(___unityPlanets00).Select(__ContextSymbol47 => new { ___p104 = __ContextSymbol47,prev = __ContextSymbol46 })
.Where(__ContextSymbol48 => ((((__ContextSymbol48.___p104.Position.z) > (__ContextSymbol48.prev.___p05.Position.z))) && (!(((__ContextSymbol48.prev.___p05) == (__ContextSymbol48.___p104))))))
.Select(__ContextSymbol49 => __ContextSymbol49.___p104)
.ToList<UnityPlanet>()).ToList<UnityPlanet>(), prev = __ContextSymbol46 })
.Where(__ContextSymbol50 => ((__ContextSymbol50.___other04.Count) == (0)))
.Select(__ContextSymbol51 => __ContextSymbol51.prev.___p05.Position.z)
.ToList<System.Single>()).ToList<System.Single>();
		MainCamera ___camera00;
		___camera00 = new MainCamera(___MinPlanetPositionX00.Head(),___MaxPlanetPositionX00.Head(),___MinPlanetPositionY00.Head(),___MinPlanetPositionZ00.Head(),___MaxPlanetPositionZ00.Head());
		List<Planet> ___planets00;
		___planets00 = (

(___unityPlanets00).Select(__ContextSymbol52 => new { ___p06 = __ContextSymbol52 })
.Select(__ContextSymbol53 => new {___owner00 = Utils.IfThenElse<Option<Commander>>((()=> ((__ContextSymbol53.___p06.IsStartingPlanet) && (((__ContextSymbol53.___p06.CommanderIndex) > (-1))))), (()=>	(new Just<Commander>(___commanders00[__ContextSymbol53.___p06.CommanderIndex]))
),(()=>	(new Nothing<Commander>())
)), prev = __ContextSymbol53 })
.Select(__ContextSymbol54 => new Planet(___constants00,__ContextSymbol54.prev.___p06,UnityRouting.getHopTable(__ContextSymbol54.prev.___p06,___unityPlanets00),__ContextSymbol54.___owner00))
.ToList<Planet>()).ToList<Planet>();
		List<Link> ___links100;
		___links100 = (

(___unityLinks00).Select(__ContextSymbol55 => new { ___l01 = __ContextSymbol55 })
.SelectMany(__ContextSymbol56=> (___planets00).Select(__ContextSymbol57 => new { ___p07 = __ContextSymbol57,
                                                      prev = __ContextSymbol56 })
.SelectMany(__ContextSymbol58=> (___planets00).Select(__ContextSymbol59 => new { ___q00 = __ContextSymbol59,
                                                      prev = __ContextSymbol58 })
.Where(__ContextSymbol60 => ((((__ContextSymbol60.prev.prev.___l01.startPlanet) == (__ContextSymbol60.prev.___p07.UnityPlanet))) && (((__ContextSymbol60.prev.prev.___l01.endPlanet) == (__ContextSymbol60.___q00.UnityPlanet)))))
.Select(__ContextSymbol61 => new Link(__ContextSymbol61.prev.prev.___l01,__ContextSymbol61.prev.___p07,__ContextSymbol61.___q00,false))
.ToList<Link>()))).ToList<Link>();
		List<Link> ___links200;
		___links200 = (

(___unityLinks00).Select(__ContextSymbol62 => new { ___l02 = __ContextSymbol62 })
.SelectMany(__ContextSymbol63=> (___planets00).Select(__ContextSymbol64 => new { ___p08 = __ContextSymbol64,
                                                      prev = __ContextSymbol63 })
.SelectMany(__ContextSymbol65=> (___planets00).Select(__ContextSymbol66 => new { ___q01 = __ContextSymbol66,
                                                      prev = __ContextSymbol65 })
.Where(__ContextSymbol67 => ((((__ContextSymbol67.prev.prev.___l02.startPlanet) == (__ContextSymbol67.prev.___p08.UnityPlanet))) && (((__ContextSymbol67.prev.prev.___l02.endPlanet) == (__ContextSymbol67.___q01.UnityPlanet)))))
.Select(__ContextSymbol68 => new Link(__ContextSymbol68.prev.prev.___l02,__ContextSymbol68.___q01,__ContextSymbol68.prev.___p08,true))
.ToList<Link>()))).ToList<Link>();
		List<Link> ___links300;
		___links300 = (___links100).Concat(___links200).ToList<Link>();
		List<Link> ___SSlinks00;
		___SSlinks00 = (

(___links300).Select(__ContextSymbol69 => new { ___link00 = __ContextSymbol69 })
.Where(__ContextSymbol70 => __ContextSymbol70.___link00.SSLink)
.Select(__ContextSymbol71 => __ContextSymbol71.___link00)
.ToList<Link>()).ToList<Link>();
		System.Collections.Generic.List<UnityStarSystem> ___star_systems00;
		___star_systems00 = UnityStarSystem.FindAllStarSystems();
		List<StarSystem> ___casanova_star_systems00;
		___casanova_star_systems00 = (

(___star_systems00).Select(__ContextSymbol72 => new { ___ss00 = __ContextSymbol72 })
.Select(__ContextSymbol73 => new StarSystem(__ContextSymbol73.___ss00,___planets00,___links300))
.ToList<StarSystem>()).ToList<StarSystem>();
		TargetedPlanet = (new Nothing<Planet>());
		StarSystems = ___casanova_star_systems00;
		Ships = (

Enumerable.Empty<Ship>()).ToList<Ship>();
		SelectionManager = new SelectionManager();
		SelectedPlanets = (

Enumerable.Empty<Planet>()).ToList<Planet>();
		ResourceBar = new ResourceBar(___commanders00);
		Planets = ___planets00;
		MiniMap = new MiniMap(___MinPlanetPositionX00.Head(),___MinPlanetPositionY00.Head(),___MinPlanetPositionZ00.Head(),___MaxPlanetPositionX00.Head(),___MaxPlanetPositionZ00.Head());
		MainCamera = ___camera00;
		Links = ___SSlinks00;
		InputMonitor = new InputController();
		Constants = ___constants00;
		Commanders = ___commanders00;
		AutoHopManager = (new Nothing<AutoHopManager>());
		AllLinks = ___links300;
		
}
Exemple #2
0
public Planet(GameConstants constants, UnityPlanet p, List<Tuple<UnityPlanet, UnityPlanet>> n, Option<Commander> c)
	{JustEntered = false;
 frame = World.frame;
		UnityPlanet = p;
		Targeted = false;
		StarSystem = (new Nothing<StarSystem>());
		ShipsToForward = (

Enumerable.Empty<Ship>()).ToList<Ship>();
		ShipToSend = (

Enumerable.Empty<TravelingShip>()).ToList<TravelingShip>();
		Selected = false;
		PlanetStats = (new Nothing<PlanetInfo>());
		Owner = c;
		Neighbours = n;
		LandingShips = (

Enumerable.Empty<LandingShip>()).ToList<LandingShip>();
		LandedShips = 0;
		InboundShips = (

Enumerable.Empty<Ship>()).ToList<Ship>();
		Constants = constants;
		Battle = (new Nothing<Battle>());
		Auto_Hop_Timer = false;
		ActiveHopsCounter = 0;
		
}
Exemple #3
0
        private GameConstants.MenuButton CheckCurrentButton(Rectangle spriteRectangle, ref int spriteTexture, GameConstants.MenuButton newState, ref GameConstants.MenuButton lastState)
        {
            var isCursorInsideButton = new bool[2];
            ChangeButtonTexture(isCursorInsideButton, ref spriteTexture);
            if (lastState == GameConstants.MenuButton.None)
            {
                isCursorInsideButton[(int)GameConstants.Hand.Left] = IsCursorInButtonArea(spriteRectangle, handSprite[(int)GameConstants.Hand.Left, handTextureType[(int)GameConstants.Hand.Left]].Rectangle);
                isCursorInsideButton[(int)GameConstants.Hand.Right] = IsCursorInButtonArea(spriteRectangle, handSprite[(int)GameConstants.Hand.Right, handTextureType[(int)GameConstants.Hand.Right]].Rectangle);

                if (isCursorInsideButton[(int)GameConstants.Hand.Left]) { cursorOnButtonState[(int)GameConstants.Hand.Left] = isCursorInsideButton[(int)GameConstants.Hand.Left]; }
                if (isCursorInsideButton[(int)GameConstants.Hand.Right]) { cursorOnButtonState[(int)GameConstants.Hand.Right] = isCursorInsideButton[(int)GameConstants.Hand.Right]; }

                if (IsButtonSelected(isCursorInsideButton))
                {
                    ChangeButtonTexture(isCursorInsideButton, ref spriteTexture);
                    if (IsCanChangeState(isCursorInsideButton))
                    {
                        return newState;
                    }
                }
            }
            return lastState;
        }