Esempio n. 1
0
 public GamePage(string launchArguments)
 {
     game = XamlGame<Game1>.Create(launchArguments, Window.Current.CoreWindow, this);
     controlClient = game.Services.GetService(typeof(IControlClient)) as IControlClient;
     DataContext = new AuthoringViewModel(controlClient);
     this.InitializeComponent();
 }
Esempio n. 2
0
        public void Load()
        {
            if (allLikedItems == null)
            {
#if NETFX_CORE
                GetLocalSaveSwarmData();
#endif
            }
            spriteBatch   = new SpriteBatch(screen.ScreenManager.GraphicsDevice);
            debugScreen   = screen.ScreenManager.Game.Services.GetService(typeof(IDebugScreen)) as IDebugScreen;
            controlClient = screen.ScreenManager.Game.Services.GetService(typeof(IControlClient)) as IControlClient;
            Viewport viewport = screen.ScreenManager.GraphicsDevice.Viewport;
            position  = new Vector2(screen.ScreenManager.GraphicsDevice.Viewport.Width - rect.Width, 0);// + _containerMargin;
            bgSprite  = screen.ScreenManager.Content.Load <Texture2D>("Backgrounds/gray");
            LabelFont = screen.ScreenManager.Fonts.DetailsFont;
            BigFont   = screen.ScreenManager.Fonts.FrameRateCounterFont;

            for (int i = 0; i < menuEntries.Count; ++i)
            {
                menuEntries[i].Initialize();
            }
#if WINDOWS
            UpdateLikedItemsUI();
#endif
            allLikedItems = SaveHelper.Load("SwarmsSaves");
        }
Esempio n. 3
0
        public GamePage(string launchArguments)
        {
            game = XamlGame <Game1> .Create(launchArguments, Window.Current.CoreWindow, this);

            controlClient = game.Services.GetService(typeof(IControlClient)) as IControlClient;
            DataContext   = new AuthoringViewModel(controlClient);
            this.InitializeComponent();
        }
Esempio n. 4
0
 public AuthoringViewModel(IControlClient controlClient)
 {
     controlViewModels = new List<ViewModels.ControlViewModel>() {
         new WorldControlViewModel(controlClient),
         new BrushControlViewModel(controlClient),
         new EraseControlViewModel(controlClient),
         new GameControlViewModel(controlClient)
     };
     ControlViewModel = controlViewModels[0];
 }
Esempio n. 5
0
 public AuthoringViewModel(IControlClient controlClient)
 {
     controlViewModels = new List <ViewModels.ControlViewModel>()
     {
         new WorldControlViewModel(controlClient),
         new BrushControlViewModel(controlClient),
         new EraseControlViewModel(controlClient),
         new GameControlViewModel(controlClient)
     };
     ControlViewModel = controlViewModels[0];
 }
Esempio n. 6
0
 public WorldControlViewModel(IControlClient controlClient)
     : base("World", "Earth.png", controlClient)
 {
     ChanceOfRandomSteering = controlClient.GetWorldRandomSteering();
     SperatingForce         = controlClient.GetWorldSeperatingForce();
     AlligningForce         = controlClient.GetWorldAligningForce();
     CohesiveForce          = controlClient.GetWorldCohesiveForce();
     NormalSpeed            = controlClient.GetWorldNormalSpeed();
     MaxSpeed = controlClient.GetWorldMaxSpeed();
     NumberOfIndividualsMax = controlClient.GetWorldNumberOfIndividuals();
     NeighborhoodRadiusMax  = controlClient.GetWorldNeighborhoodRadius();
 }
Esempio n. 7
0
 public WorldControlViewModel(IControlClient controlClient)
     : base("World", "Earth.png", controlClient)
 {
     ChanceOfRandomSteering = controlClient.GetWorldRandomSteering();
     SperatingForce = controlClient.GetWorldSeperatingForce();
     AlligningForce = controlClient.GetWorldAligningForce();
     CohesiveForce = controlClient.GetWorldCohesiveForce();
     NormalSpeed = controlClient.GetWorldNormalSpeed();
     MaxSpeed = controlClient.GetWorldMaxSpeed();
     NumberOfIndividualsMax = controlClient.GetWorldNumberOfIndividuals();
     NeighborhoodRadiusMax = controlClient.GetWorldNeighborhoodRadius();
 }
Esempio n. 8
0
        public override void LoadContent()
        {
            individualTexture    = ScreenManager.Content.Load <Texture2D>("point");
            bigIndividualTexture = ScreenManager.Content.Load <Texture2D>("beebig");
            superAgentTexture    = ScreenManager.Content.Load <Texture2D>("Backgrounds/gray");

            debugComponent = ScreenManager.Game.Services.GetService(typeof(IDebugScreen)) as IDebugScreen;
            controlClient  = ScreenManager.Game.Services.GetService(typeof(IControlClient)) as IControlClient;

            Camera = new SwarmsCamera(ScreenManager.GraphicsDevice);
            Border = new Border(ScreenManager);
            base.LoadContent();
        }
Esempio n. 9
0
 public BrushControlViewModel(IControlClient controlClient)
     : base("Brush", "Paint.png", controlClient)
 {
     ChanceOfRandomSteering = controlClient.GetBrushRandomSteering();
     SperatingForce = controlClient.GetBrushSeperatingForce();
     AlligningForce = controlClient.GetBrushAligningForce();
     CohesiveForce = controlClient.GetBrushCohesiveForce();
     NormalSpeed = controlClient.GetBrushNormalSpeed();
     MaxSpeed = controlClient.GetBrushMaxSpeed();
     NeighborhoodRadiusMax = controlClient.GetBrushNeighborhoodRadius();
     BrushColor = controlClient.GetBrushColor();
     IsMobile = controlClient.GetBrushIsMobile();
     StartingDirection = controlClient.GetBrushStartingDirection();
     IsUndo = controlClient.GetBrushIsUndo();
 }
Esempio n. 10
0
 public BrushControlViewModel(IControlClient controlClient)
     : base("Brush", "Paint.png", controlClient)
 {
     ChanceOfRandomSteering = controlClient.GetBrushRandomSteering();
     SperatingForce         = controlClient.GetBrushSeperatingForce();
     AlligningForce         = controlClient.GetBrushAligningForce();
     CohesiveForce          = controlClient.GetBrushCohesiveForce();
     NormalSpeed            = controlClient.GetBrushNormalSpeed();
     MaxSpeed = controlClient.GetBrushMaxSpeed();
     NeighborhoodRadiusMax = controlClient.GetBrushNeighborhoodRadius();
     BrushColor            = controlClient.GetBrushColor();
     IsMobile          = controlClient.GetBrushIsMobile();
     StartingDirection = controlClient.GetBrushStartingDirection();
     IsUndo            = controlClient.GetBrushIsUndo();
 }
Esempio n. 11
0
 public GameControlViewModel(IControlClient controlClient)
     : base("Game", "Games.png", controlClient)
 {
 }
Esempio n. 12
0
 public GameControlViewModel(IControlClient controlClient)
     : base("Game", "Games.png", controlClient)
 {
 }
Esempio n. 13
0
 public ControlViewModel(string name, string iconPath, IControlClient controlclient)
 {
     Name = name;
     IconPath = ImageBasePath + iconPath;
     controlClient = controlclient;
 }
Esempio n. 14
0
 public ClientsController()
 {
     control = new ControlClient();
 }
Esempio n. 15
0
        public void Load()
        {
            if (allLikedItems == null)
            {
#if NETFX_CORE
                GetLocalSaveSwarmData();
#endif
            }
            spriteBatch = new SpriteBatch(screen.ScreenManager.GraphicsDevice);
            debugScreen = screen.ScreenManager.Game.Services.GetService(typeof(IDebugScreen)) as IDebugScreen;
            controlClient = screen.ScreenManager.Game.Services.GetService(typeof(IControlClient)) as IControlClient;
            Viewport viewport = screen.ScreenManager.GraphicsDevice.Viewport;
            position = new Vector2(screen.ScreenManager.GraphicsDevice.Viewport.Width - rect.Width, 0);// + _containerMargin;
            bgSprite = screen.ScreenManager.Content.Load<Texture2D>("Backgrounds/gray");
            LabelFont = screen.ScreenManager.Fonts.DetailsFont;
            BigFont = screen.ScreenManager.Fonts.FrameRateCounterFont;

            for (int i = 0; i < menuEntries.Count; ++i)
            {
                menuEntries[i].Initialize();
            }
#if WINDOWS
            UpdateLikedItemsUI();
#endif
            allLikedItems = SaveHelper.Load("SwarmsSaves");
        }
Esempio n. 16
0
 public EraseControlViewModel(IControlClient controlClient)
     : base("Erase", "X.png", controlClient)
 {
     EraseDiameter = controlClient.GetEraseDiameter();
 }
Esempio n. 17
0
        public override void LoadContent()
        {
            individualTexture = ScreenManager.Content.Load<Texture2D>("point");
            bigIndividualTexture = ScreenManager.Content.Load<Texture2D>("beebig");
            superAgentTexture = ScreenManager.Content.Load<Texture2D>("Backgrounds/gray");

            debugComponent = ScreenManager.Game.Services.GetService(typeof(IDebugScreen)) as IDebugScreen;
            controlClient = ScreenManager.Game.Services.GetService(typeof(IControlClient)) as IControlClient;

            Camera = new SwarmsCamera(ScreenManager.GraphicsDevice);
            Border = new Border(ScreenManager);
            base.LoadContent();
        }
Esempio n. 18
0
 public ControlViewModel(string name, string iconPath, IControlClient controlclient)
 {
     Name          = name;
     IconPath      = ImageBasePath + iconPath;
     controlClient = controlclient;
 }
Esempio n. 19
0
 public EraseControlViewModel(IControlClient controlClient)
     : base("Erase", "X.png", controlClient)
 {
     EraseDiameter = controlClient.GetEraseDiameter();
 }