コード例 #1
0
    void InitRecipes()
    {
        RecipeManager.AddShapelessRecipe(new int[] { 2 }, ItemLoader.CreateItem(5), 4);       //Log to planks
        RecipeManager.AddShapelessRecipe(new int[] { 5 }, ItemLoader.CreateItem(6), 4);       //Plank to stick
        RecipeManager.AddShapelessRecipe(new int[] { 3, 3 }, ItemLoader.CreateItem(6), 1);    //Twig to stick
//		RecipeManager.AddShapedRecipe(new int[] {0, -1, 0, 0}, ItemLoader.GetItemData(1)); //Dirt to rock
    }
コード例 #2
0
        public IActionResult Recipe(string id)
        {
            long idAsLong = 0;

            if (!long.TryParse(id, out idAsLong))
            {
                throw new Exception("Invalid id");
            }

            Recipe.Monolith.Models.Recipe recipe = RecipeManager.GetRecipeById(idAsLong);
            if (recipe == null)
            {
                throw new Exception($"Recipe not found for id {id}");
            }

            // increase hit count for selected recipe
            if (recipe.Hits == null)
            {
                recipe.Hits = 1;
            }
            else
            {
                recipe.Hits++;
            }
            RecipeManager.UpdateRecipe(idAsLong, recipe);

            return(View(recipe));
        }
コード例 #3
0
 public void repopulateSource(BasketMealsRecord[] items)
 {
     m_mealDict      = new Dictionary <int, BasketTableItem>();
     m_selectedItems = new List <NSIndexPath>();
     foreach (BasketMealsRecord bmr in items)
     {
         //create new table item
         //BasketTableItem bti = new BasketTableItem();
         // get recipe record for meal
         RecipeMealsRecord rmr = RecipeManager.GetRecipeMealRecord(bmr.RecipeMealsID);
         // record fo each meal id
         BasketTableItem bti;
         string          unit = "";
         m_mealDict.TryGetValue(rmr.MealID, out bti);
         if (bti == null)
         {
             bti = new BasketTableItem();
             MealRecord mr = MealManager.GetMeal(rmr.MealID);
             bti.m_meal_name = mr.Name;
             //save units first
             bti.m_unit = mr.MealDesc;
         }
         bti.m_weight += rmr.Qty;
         bti.m_bmIDs.Add(bmr.ID);
         m_mealDict[rmr.MealID] = bti;
     }
     m_tableItems = new BasketTableItem[m_mealDict.Count];
     m_mealDict.Values.CopyTo(m_tableItems, 0);
 }
コード例 #4
0
ファイル: Player.cs プロジェクト: Elendow/GGJ2016
	void Awake() 
	{
		_recipeManager 	= FindObjectOfType<RecipeManager>();
		_musicManager 	= FindObjectOfType<MusicManager>();
		_rigidbody 		= GetComponent<Rigidbody2D>();
		_collider 		= GetComponent<Collider2D>();
		_animator		= GetComponent<Animator> ();
		_initPos 		= transform.position;

 		if(GameManager.Instance.playerDevices.Count > playerNum - 1)
		{
			//Take the controller assigned on the menu
			_playerInput 		= new PlayerInput(true);
			_playerInput.Device = InputManager.Devices[GameManager.Instance.playerDevices[playerNum - 1]];
			Debug.Log(playerNum + " " + _playerInput.Device.Name);
		}
		else
		{
			//Test only
			Debug.Log("Controllers " + InputManager.Devices.Count);

			if(InputManager.Devices.Count > playerNum - 1)
			{
				_playerInput = new PlayerInput(true);
				_playerInput.Device = InputManager.Devices[playerNum - 1];
			}
			else if(playerNum == 4)
				_playerInput = new PlayerInput(false);
			
			Debug.LogWarning("No input for player " + playerNum);
		}

		FindObjectOfType<GameOverManager>().OnGameOver += HandleGameOver;
	}
コード例 #5
0
ファイル: BuildCommand.cs プロジェクト: Tembocs/Soup
        /// <summary>
        /// Invoke
        /// </summary>
        public async Task InvokeAsync(BuildOptions options)
        {
            var recipePath = Directory.GetCurrentDirectory();
            var recipe     = await RecipeManager.LoadFromFileAsync(recipePath);

            if (recipe == null)
            {
                Log.Error("Could not find the recipe file.");
                return;
            }

            // Ensure the library directory exists
            var libraryPath = PackageManager.BuildKitchenLibraryPath(_config);

            if (!Directory.Exists(libraryPath))
            {
                Directory.CreateDirectory(libraryPath);
            }

            // Now build the current project
            Log.Info(string.Empty);
            Log.Info("Building Project");
            var buildPath   = Path.Combine(Constants.ProjectGenerateFolderName, Constants.StoreBuildFolderName);
            var buildEngine = new BuildEngine(_config, _compiler);
            await buildEngine.ExecuteAsync(recipePath, recipe, options.Force);
        }
コード例 #6
0
ファイル: RecipTableSrc.cs プロジェクト: Sushinski/ducanity
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            //[Take Row]
            RecipeTWCell cell = tableView.CellAt(indexPath) as RecipeTWCell;

            if (cell != null)
            {
                if (cell.m_bWasChanged)
                {
                    RecipeRecord rec = RecipeManager.GetRecipeRecord(m_tableItems[indexPath.Row].ID);
                    rec.isFavourite = cell.m_bChecked ? 1 : 0;
                    RecipeManager.SaveRecipeRecord(rec);
                    cell.m_bWasChanged = false;
                }
                else
                {
                    // add pages
                    DukappPagedDataSource qsrc = new DukappPagedDataSource(2);
                    DukappPagedVC         mp   = new DukappPagedVC(qsrc);
                    MealsVC     rec_meals      = new MealsVC(m_tableItems[indexPath.Row], m_parent_vc);
                    HowToCookVC cook_vc        = new HowToCookVC(m_tableItems[indexPath.Row]);
                    mp.m_pages.Add(rec_meals);
                    mp.m_pages.Add(cook_vc);
                    mp.SetViewControllers(new UIViewController[] { rec_meals }, UIPageViewControllerNavigationDirection.Forward, true, null);
                    m_parent_vc.NavigationController.PushViewController(mp, true);
                }
            }
        }
コード例 #7
0
ファイル: ACE.cs プロジェクト: cydrith/ACE
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit);

            var logRepository = LogManager.GetRepository(System.Reflection.Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));

            log.Info("Starting ACEmulator...");
            Console.Title = @"ACEmulator";

            ConfigManager.Initialize();
            ServerManager.Initialize();
            DatabaseManager.Initialize();
            AssetManager.Initialize();
            InboundMessageManager.Initialize();
            DatabaseManager.Start();
            DatManager.Initialize();
            GuidManager.Initialize();
            SocketManager.Initialize();
            WorldManager.Initialize();
            CommandManager.Initialize();
            RecipeManager.Initialize();

            DatabaseManager.Start();
        }
コード例 #8
0
        public async Task SetRecipe(RecipeDetailsEntry recipe)
        {
            ItemDetailsEntry item    = null;
            Bitmap           image   = null;
            string           details = await Task.Run <string>(async() =>
            {
                try
                {
                    var itemTask   = ItemManager.Instance.GetItem(recipe.OutputItemId).ConfigureAwait(false);
                    var detailTask = RecipeManager.GetRecipeString(recipe);
                    var imageTask  = RecipeManager.GetRecipeImage(recipe);
                    item           = await itemTask;
                    image          = await imageTask;
                    return(await detailTask);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                return("Error occured\n");
            });

            labelRecipeDetails.Text = details;
            labelRecipeName.Text    = item != null ? item.Name : "Error Getting Item Details";
            pictureBox1.Image       = image;
        }
コード例 #9
0
        public IActionResult Recipe(string id)
        {
            long idAsLong = 0;

            if (!long.TryParse(id, out idAsLong))
            {
                throw new Exception("Invalid id");
            }

            Models.Recipe recipe = RecipeManager.GetRecipeById(idAsLong);
            if (recipe == null)
            {
                throw new Exception($"Recipe not found for id {id}");
            }

            // Demo: Data breakpoints
            if (recipe.Hits == null)
            {
                recipe.Hits = 1;
            }
            else
            {
                recipe.Hits++;
            }
            RecipeManager.UpdateRecipe(idAsLong, recipe);

            return(View(recipe));
        }
コード例 #10
0
 public Recipe SetFabricators(string[] fabricators, float fabricationTime)
 {
     this.fabricators = fabricators;
     FabricationTime  = fabricationTime;
     RecipeManager.Get().Add(this);
     return(this);
 }
コード例 #11
0
        public void TestWizardValues()
        {
            var extensionManager = new MockExtensionManager();

            extensionManager.AddGuidancePackage(@"Services\DictionaryServiceTest.xml");

            IRecipeManagerService manager = new RecipeManager();

            ((IServiceContainer)manager).AddService(typeof(IPersistenceService),
                                                    new MockServices.MockPersistenceService());
            ((IServiceContainer)manager).AddService(typeof(IUIService),
                                                    new MockServices.MockUIService());

            manager.AddService(typeof(SVsExtensionManager), extensionManager);

            // Load the package from the config.
            GuidancePackage package = new GuidancePackage(new XmlTextReader(Utils.MakeTestRelativePath(@"Services\DictionaryServiceTest.xml")));

            manager.EnablePackage(package);

            // Add dependant mock services.
            package.AddService(typeof(EnvDTE._DTE), new MockServices.MockDte());
            package.AddService(typeof(IValueGatheringService), new WizardFramework.WizardGatheringService());
            package.AddService(typeof(SVsExtensionManager), extensionManager);

            // DictionaryTestStep class is the one that performs the actual checks on the values.
            package.Execute(new MockObjects.MockReference("TestDictionary", "/Services"));
        }
コード例 #12
0
        public void AddCraftingRecipes()
        {
            RecipeManager.AddRecipe("blacksmithing",
                                    new List <InventoryItem> {
                RecipeManager.Item("planks", 1),
                RecipeManager.Item("ironingot", 1),
                RecipeManager.Item("feather", 1)
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("arrow", 12)
            },
                                    true);

            RecipeManager.AddRecipe("masonry",
                                    new List <InventoryItem> {
                RecipeManager.Item("stoneblock", 1)
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("stonebricks", 1)
            },
                                    true, true);

            RecipeManager.AddFueledRecipe("baking",
                                          new List <InventoryItem> {
                RecipeManager.Item("flour", 5),
                RecipeManager.Item("waterbottle", 1)
            },
                                          new List <InventoryItem> {
                RecipeManager.Item("bread", 2),
                RecipeManager.Item("bottle", 1)
            },
                                          0.26f);
        }
コード例 #13
0
        public static void Main(string[] args)
        {
            //Setup Database
            var mj = new MakeJsonFiles(new FileClient());

            mj.CreateAllTables();

            //Poor Man DI
            var ingredientRepository        = new IngredientRepository(new FileClient());
            var recipeRepository            = new RecipeRepository(new FileClient());
            var recipeIngredientRespository = new RecipeIngredientRepository(new FileClient());
            var recipeManager = new RecipeManager(
                ingredientRepository,
                recipeRepository,
                recipeIngredientRespository
                );

            //Start Program
            var recipes = recipeManager.GetAll();

            foreach (var recipe in recipes)
            {
                var receipt = new RecipeReceipt(recipe);
                Console.WriteLine(receipt.ToString());
            }
        }
コード例 #14
0
    // Use this for initialization

    private void Awake()
    {
        _instance  = this;
        recipes    = new MaterialRecipe[2][];
        recipes[0] = aRecipes;
        recipes[1] = bRecipes;
    }
コード例 #15
0
ファイル: MainViewModel.cs プロジェクト: vassmse/RecipeBook
 public MainViewModel()
 {
     _businessLayer = new RecipeManager();
     RecipeBook     = new MyRecipeBook(_businessLayer);
     SelectedRecipe = RecipeBook.Recipes[1];
     NewRecipe      = new Recipe();
 }
コード例 #16
0
ファイル: RecipTableSrc.cs プロジェクト: Sushinski/ducanity
        public RecipTableSrc(DietPhaseId phase, UIViewController parent)
        {
            m_parent_vc = parent;
            List <RecipeRecord> recipesList = RecipeManager.GetRecipesForPhase(new DietPhase(phase));

            m_tableItems = recipesList.ToArray();
        }
コード例 #17
0
 private bool ShouldBeDiscovered(Tag food_id)
 {
     if (WorldInventory.Instance.IsDiscovered(food_id))
     {
         return(true);
     }
     foreach (Recipe recipe in RecipeManager.Get().recipes)
     {
         if (recipe.Result == food_id)
         {
             string[] fabricators = recipe.fabricators;
             foreach (string id in fabricators)
             {
                 if (Db.Get().TechItems.IsTechItemComplete(id))
                 {
                     return(true);
                 }
             }
         }
     }
     foreach (Crop item in Components.Crops.Items)
     {
         if (Grid.IsVisible(Grid.PosToCell(item.gameObject)) && item.cropId == food_id.Name)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #18
0
        public void After_Edit_ValidObject_Get_Should_Changed()
        {
            // Arrange
            DbContextOptions <RepositoryContext> options = new MockDBHandler().CategoryWithThreeMember().CountryWithThreeMember().UnitWithThreeMember().IngredientWithThreeMember().ReciptWithThreeMember().build();

            using (var context = new RepositoryContext(options))
            {
                ICustomMapper            _customMapper  = new CustomMapper(context);
                IDataRepository <Recipe> mockRepository = new RecipeManager(context);

                RecipeController recipecontroller = new RecipeController(mockRepository, _mapper, _customMapper, _usermanager);
                //Act
                var forEdit = new MockDBHandler().buildMockRecipeView();
                forEdit.ID = 1; // Because In mock it is something else and in equalation assert result to false
                OkObjectResult  okresult = recipecontroller.Get(1) as OkObjectResult;
                RecipeViewModel origin   = okresult.Value as RecipeViewModel;
                recipecontroller.Put(origin.ID, forEdit);

                OkObjectResult  okresultAfterEdit = recipecontroller.Get(1) as OkObjectResult;
                RecipeViewModel afterEdit         = okresultAfterEdit.Value as RecipeViewModel;

                // Assert

                Assert.True(forEdit.Equals(afterEdit));
                Assert.False(origin.Equals(afterEdit));
            }
        }
コード例 #19
0
ファイル: PublishCommand.cs プロジェクト: Tembocs/Soup
        /// <summary>
        /// Invoke
        /// </summary>
        public async Task InvokeAsync(PublishOptions options)
        {
            var projectDirectory = Directory.GetCurrentDirectory();
            var recipe           = await RecipeManager.LoadFromFileAsync(projectDirectory);

            Log.Info($"Publish Project: {recipe.Name}@{recipe.Version}");

            var result = await _soupIdentity.AuthenticateUserAsync();

            using (var stream = new MemoryStream())
            {
                // Pack the project into a memory stream
                await PackageManager.PackAsync(recipe, projectDirectory, stream);

                // Reset the stream so we can read from it
                stream.Seek(0, SeekOrigin.Begin);

                // Publish the package to the service
                try
                {
                    bool created = await _soupApi.PublishPackageAsync(recipe.Name, stream);

                    if (!created)
                    {
                        Log.Warning("The package version already existed! No change was made.");
                    }
                }
                catch (HttpRequestException ex)
                {
                    Log.Error($"Failed request: {ex.ToString()}");
                }
            }
        }
 public frmSelectItem(RecipeManager recipeManager, ItemManager itemManager)
 {
     InitializeComponent();
     _recipeManager = recipeManager;
     _itemManager   = itemManager;
     SetupSelectItem();
 }
コード例 #21
0
        // Smelting Recipes
        public void AddSmeltingRecipes()
        {
            RecipeManager.AddRecipe("smelting",
                                    new List <InventoryItem> {
                RecipeManager.Item("ironore", 3)
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("ironingot", 1)
            },
                                    0.2f);

            RecipeManager.AddRecipe("smelting",
                                    new List <InventoryItem> {
                RecipeManager.Item("goldore", 3)
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("goldingot", 1)
            },
                                    0.2f);

            RecipeManager.AddRecipe("pottery",
                                    new List <InventoryItem> {
                RecipeManager.Item("clay", 3)
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("bricks", 3)
            },
                                    0.2f);
        }
コード例 #22
0
        // Techhnologist Recipes
        public void AddTechnologistRecipes()
        {
            RecipeManager.AddRecipe("technologist",
                                    new List <InventoryItem> {
                RecipeManager.Item("bread", 1),
                RecipeManager.Item("berry", 5),
                RecipeManager.Item("clothing", 1),
                RecipeManager.Item("linenbag", 1),
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("sciencebaglife", 2)
            },
                                    0.0f);

            RecipeManager.AddRecipe("technologist",
                                    new List <InventoryItem> {
                RecipeManager.Item("ironingot", 1),
                RecipeManager.Item("bricks", 3),
                RecipeManager.Item("goldcoin", 1),
                RecipeManager.Item("linenbag", 1),
            },
                                    new List <InventoryItem> {
                RecipeManager.Item("sciencebagbasic", 2)
            },
                                    0.0f);
        }
コード例 #23
0
    void Initialize()
    {
        DifficultySettings = GameDifficultySettings.GetPresetDifficultySettings(GameDifficultySettings.GameDifficultyType.GameDifficulty_Easy);
        if (m_CustomerManager == null)
        {
            m_CustomerManager = new CustomerManager();
            m_CustomerManager.Initialize(this);
        }

        if (m_InnManager == null)
        {
            m_InnManager = new InnManager();
            m_InnManager.Initialize(this);
        }

        if (m_UIManager == null)
        {
            m_UIManager = new UIManager();
            m_UIManager.Initialize(this);
        }

        if (m_RecipeManager == null)
        {
            m_RecipeManager = new RecipeManager();
            m_RecipeManager.Initialize(this);
        }
    }
コード例 #24
0
        private async Task <Recipe> UnpackArchiveAsync(string tempPath, Stream packageFile)
        {
            // Unpack the zip file into the package directory
            var tempPackagePath = Path.Combine(tempPath, Constants.StorePackageFolderName);

            Directory.CreateDirectory(tempPackagePath);
            await PackageManager.ExtractAsync(packageFile, tempPackagePath);

            // Load the packages recipe file
            var recipe = await RecipeManager.LoadFromFileAsync(tempPackagePath);

            var packagePath = PackageManager.BuildKitchenPackagePath(_config, recipe);

            // TODO : Perform some verification that the package is valid

            // TODO : Should not hit this when, verify the package exists before download
            // For now delete and recreate it
            if (Directory.Exists(packagePath))
            {
                Directory.Delete(packagePath, true);
            }

            // Ensure the parent directory exists
            var packageParentDirectory = Directory.GetParent(packagePath);

            if (!packageParentDirectory.Exists)
            {
                packageParentDirectory.Create();
            }

            // Move the results out of the staging directory
            Directory.Move(tempPackagePath, packagePath);

            return(recipe);
        }
コード例 #25
0
ファイル: RecipTableSrc.cs プロジェクト: Sushinski/ducanity
        public RecipTableSrc(RecipeSrcType type, UIViewController parent)
        {
            m_parent_vc = parent;
            List <RecipeRecord> recipesList = RecipeManager.GetRecipeRecords(type);

            m_tableItems = recipesList.ToArray();
        }
コード例 #26
0
        private void CreateOrder_OnClick(object sender, RoutedEventArgs e)
        {
            if (Recipe.Medicines == null || Recipe.Patient == null)
            {
                return;
            }

            var doctor = new Doctor()
            {
                LastName      = doctorLastName.Text,
                FirstName     = doctorFirstName.Text,
                SecondaryName = doctorFathersName.Text
            };

            try
            {
                var doctorId = DoctorManager.Insert(doctor);
                Recipe.Doctor = new Doctor(doctorId);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Doctor information is empty");
                return;
            }

            Guid recipeId;

            try
            {
                Recipe.Diagnoz = diagnoz.Text;
                recipeId       = RecipeManager.Insert(Recipe);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Recipe information is empty");
                return;
            }

            var order = new Order
            {
                Recipe      = new Recipe(recipeId),
                TotalPrice  = Recipe.Medicines.Sum(m => m.Price),
                PhoneNumber = Recipe.Patient.PhoneNumber,
                OrderDate   = DateTime.Now,
                AvailabilityOfComponents = new Random().Next(100),
                MakeState = OrderState.Open,
                ReadyTime = DateTime.Now.AddDays(new Random().Next(1, 10))
            };

            try
            {
                OrderManager.Insert(order);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("order information is empty");
                return;
            }
            this.Close();
        }
コード例 #27
0
ファイル: Confirmation.cs プロジェクト: wmatuszak/ACE
        public override void ProcessConfirmation(bool response, bool timeout = false)
        {
            var player = Player;

            if (player == null)
            {
                return;
            }

            if (!response)
            {
                player.SendWeenieError(WeenieError.YouChickenOut);

                return;
            }

            // inventory only?
            var source = player.FindObject(SourceGuid.Full, Player.SearchLocations.LocationsICanMove);
            var target = player.FindObject(TargetGuid.Full, Player.SearchLocations.LocationsICanMove);

            if (source == null || target == null)
            {
                return;
            }

            RecipeManager.UseObjectOnTarget(player, source, target, true);
        }
コード例 #28
0
    private void Awake()
    {
        _instance = this;

        _recipeCode1 = GenerateRecipeCode(Recipe1);
        _recipeTable[_recipeCode1]    = true;
        RecipeImageHash[_recipeCode1] = recipe1Image;

        _recipeCode2 = GenerateRecipeCode(Recipe2);
        _recipeTable[_recipeCode2]    = true;
        RecipeImageHash[_recipeCode2] = recipe2Image;

        _recipeCode3 = GenerateRecipeCode(Recipe3);
        _recipeTable[_recipeCode3]    = true;
        RecipeImageHash[_recipeCode3] = recipe3Image;

        _recipeCode4 = GenerateRecipeCode(Recipe4);
        _recipeTable[_recipeCode4]    = true;
        RecipeImageHash[_recipeCode4] = recipe4Image;

        _recipeCode5 = GenerateRecipeCode(Recipe5);
        _recipeTable[_recipeCode5]    = true;
        RecipeImageHash[_recipeCode5] = recipe5Image;

        _recipeCode6 = GenerateRecipeCode(Recipe6);
        _recipeTable[_recipeCode6]    = true;
        RecipeImageHash[_recipeCode6] = recipe6Image;
    }
コード例 #29
0
        /// <summary>
        /// Recursively iterates the recipe list looking for foods that can be made with this
        /// item.
        /// </summary>
        /// <param name="item">The item to search.</param>
        /// <param name="found">The foods found so far.</param>
        /// <param name="seen">The items already seen, to prevent recipe loops from crashing.</param>
        /// <param name="quantity">The quantity of the base item.</param>
        private void SearchForRecipe(Tag item, IList <FoodResult> found, ICollection <Tag> seen,
                                     float quantity)
        {
            var prefab = Assets.GetPrefab(item);

            if (prefab != null && quantity > 0.0f && !seen.Contains(item))
            {
                var   edible = prefab.GetComponent <Edible>();
                float kcal;
                seen.Add(item);
                // Item itself is usable as food
                if (edible != null && (kcal = edible.FoodInfo.CaloriesPerUnit) > 0.0f)
                {
                    found.Add(new FoodResult(kcal, quantity, item));
                }
                // Search for recipes using this item
                foreach (var recipe in RecipeManager.Get().recipes)
                {
                    float amount = 0.0f;
                    foreach (var ingredient in recipe.Ingredients)
                    {
                        // Search for this item in the recipe
                        if (ingredient.tag == item)
                        {
                            amount = ingredient.amount;
                            break;
                        }
                    }
                    if (amount > 0.0f)
                    {
                        SearchForRecipe(recipe.Result, found, seen, recipe.OutputUnits *
                                        quantity / amount);
                    }
                }
                // And complex ones too
                foreach (var recipe in ComplexRecipeManager.Get().recipes)
                {
                    float amount = 0.0f;
                    foreach (var ingredient in recipe.ingredients)
                    {
                        // Search for this item in the recipe
                        if (ingredient.material == item)
                        {
                            amount = ingredient.amount;
                            break;
                        }
                    }
                    if (amount > 0.0f)
                    {
                        // Check all results of the recipe
                        foreach (var result in recipe.results)
                        {
                            SearchForRecipe(result.material, found, seen, result.amount *
                                            quantity / amount);
                        }
                    }
                }
            }
        }
コード例 #30
0
 public static RecipeManager Get()
 {
     if (_Instance == null)
     {
         _Instance = new RecipeManager();
     }
     return(_Instance);
 }
コード例 #31
0
        /// <summary>
        /// Invoke
        /// </summary>
        public async Task InvokeAsync(PackOptions options)
        {
            var recipe = await RecipeManager.LoadFromFileAsync(@"./");

            Log.Info($"Packaging Project: {recipe.Name}@{recipe.Version}");

            await PackageManager.PackAsync(recipe, Directory.GetCurrentDirectory());
        }
コード例 #32
0
        private AnimalManager manager = null; // MainGUI "har en" AnimalManager
        /// <summary>
        /// Default konstruktor som instansierar ett objekt av AnimalManager samt fyller i alla nödvändiga värden
        /// </summary>
        public MainGUI()
        {
            InitializeComponent();

            manager = new AnimalManager(); // Instansiera AnimalManagern

            InitializeGUI(); // Börjar med att fylla i alla nödvändiga värden

            foodManager = new RecipeManager();
        }
コード例 #33
0
        public RecipeForm()
        {
            InitializeComponent();
            if (m_recipe == null)
            {
                m_recipe = new Recipe();
            }

            rcpMngr = new RecipeManager();

            //Instantiate som test value
            textBoxNameFood.Text = "Pankaka";
            textBoxNameIngred.Text = "2 Ägg";
        }
コード例 #34
0
ファイル: Totem.cs プロジェクト: Elendow/GGJ2016
	private void Start()
	{
		_musicManager =	GameObject.FindObjectOfType<MusicManager> ();
		_recipeManager = GameObject.FindObjectOfType<RecipeManager>();
		_ambientManager = GameObject.FindObjectOfType<AmbientManager>();
		_gameOverManager = GameObject.FindObjectOfType<GameOverManager>();
		//_gameOverManager.OnGameStart += Init;
		_shaker = Camera.main.GetComponent<ProCamera2DShake> ();

		if(_recipeManager == null)
			Debug.LogError("Recipe Manager is Missing!");

		Init ();
	}
コード例 #35
0
 public void Setup()
 {
     repository = new RecipeRepository();
     manager = new RecipeManager(repository);
 }