コード例 #1
0
ファイル: GamePage.xaml.cs プロジェクト: kbo4sho/Swarm
 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();
 }
コード例 #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");
        }
コード例 #3
0
ファイル: GamePage.xaml.cs プロジェクト: armangharib/Swarm
        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();
        }
コード例 #4
0
ファイル: AuthoringViewModel.cs プロジェクト: kbo4sho/Swarm
 public AuthoringViewModel(IControlClient controlClient)
 {
     controlViewModels = new List<ViewModels.ControlViewModel>() {
         new WorldControlViewModel(controlClient),
         new BrushControlViewModel(controlClient),
         new EraseControlViewModel(controlClient),
         new GameControlViewModel(controlClient)
     };
     ControlViewModel = controlViewModels[0];
 }
コード例 #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];
 }
コード例 #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();
 }
コード例 #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();
 }
コード例 #8
0
ファイル: SwarmScreenBase.cs プロジェクト: armangharib/Swarm
        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();
        }
コード例 #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();
 }
コード例 #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();
 }
コード例 #11
0
ファイル: GameControlViewModel.cs プロジェクト: kbo4sho/Swarm
 public GameControlViewModel(IControlClient controlClient)
     : base("Game", "Games.png", controlClient)
 {
 }
コード例 #12
0
 public GameControlViewModel(IControlClient controlClient)
     : base("Game", "Games.png", controlClient)
 {
 }
コード例 #13
0
ファイル: ControlViewModel.cs プロジェクト: kbo4sho/Swarm
 public ControlViewModel(string name, string iconPath, IControlClient controlclient)
 {
     Name = name;
     IconPath = ImageBasePath + iconPath;
     controlClient = controlclient;
 }
コード例 #14
0
 public ClientsController()
 {
     control = new ControlClient();
 }
コード例 #15
0
ファイル: ButtonSection.cs プロジェクト: kbo4sho/Swarm
        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");
        }
コード例 #16
0
 public EraseControlViewModel(IControlClient controlClient)
     : base("Erase", "X.png", controlClient)
 {
     EraseDiameter = controlClient.GetEraseDiameter();
 }
コード例 #17
0
ファイル: SwarmScreenBase.cs プロジェクト: kbo4sho/Swarm
        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();
        }
コード例 #18
0
ファイル: ControlViewModel.cs プロジェクト: armangharib/Swarm
 public ControlViewModel(string name, string iconPath, IControlClient controlclient)
 {
     Name          = name;
     IconPath      = ImageBasePath + iconPath;
     controlClient = controlclient;
 }
コード例 #19
0
 public EraseControlViewModel(IControlClient controlClient)
     : base("Erase", "X.png", controlClient)
 {
     EraseDiameter = controlClient.GetEraseDiameter();
 }