示例#1
0
 private void TurnOptionsOff()
 {
     Types.SetActive(false);
     Rarities.SetActive(false);
     Plates.SetActive(false);
     MonsterList.SetActive(false);
 }
示例#2
0
        private void DeletePlate(object obj)
        {
            PlateCount pc = obj as PlateCount;

            Plates.Remove(pc);
            UpdateAvailablePlates();
        }
 public void compareToRecipe(Plates plate)
 {
     if (gameState)
     {
         countRecipe = 0;
         tookDish    = false;
         //Compare each recipe
         foreach (Recipe recipe in currentRecipes)
         {
             if (recipe)
             {                //Check if they have the same # of ingredients
                 if (plate.recipe.Count == recipe.recipe.Count)
                 {
                     //Compare each ingredient
                     for (int a = 0; a < plate.recipe.Count; a++)
                     {
                         if (!(plate.recipe[a] == recipe.recipe[a]))
                         {
                             break;
                         }
                         else if ((a + 1) == plate.recipe.Count && !tookDish)
                         {
                             GameObject correct = Instantiate(checkmark, new Vector3(plate.transform.position.x, plate.transform.position.y + 0.1f, plate.transform.position.z), Quaternion.identity);
                             Destroy(correct, 3.0f);
                             Destroy(currentRecipes[countRecipe].gameObject);
                             currentRecipes.Remove(recipe);
                             tookDish = true;                        //Stops duplicate chits from being handed in at the same time
                             spawnCounter--;                         //Moves the chit line down by 1
                             //Updates Score
                             if (countRecipe == 0)
                             {
                                 if (firstDishMultiplier != 5)
                                 {
                                     firstDishMultiplier += 1;
                                 }
                             }
                             else
                             {
                                 firstDishMultiplier = 1;
                             }
                             playerScore += pointsPerDish * firstDishMultiplier;
                             moveRecipesDown(); //Moves recipes down
                             return;
                         }
                     }
                 }
             }
             countRecipe++;
         }
         //Subtract Points if the player submits the wrong order
         if (playerScore != 0)
         {
             playerScore -= pointsPerDish;
         }
         GameObject wrongOrder = Instantiate(incorrect, new Vector3(plate.transform.position.x, plate.transform.position.y + 0.1f, plate.transform.position.z), Quaternion.identity);
         Destroy(wrongOrder, 3.0f);
     }
 }
示例#4
0
 void Start()
 {
     animator = GetComponent <Animator>();
     //is using the variables of the script plates
     script1          = plate1.GetComponent <Plates>(); //acesses plate 1
     script2          = plate2.GetComponent <Plates>(); //acesses plate 2
     pressure_plate_1 = false;
     pressure_plate_2 = false;
 }
示例#5
0
    private bool ScanAllPlates()
    {
        foreach (GameObject Plates in ListOfPlates)
        {
            PressurePlate _plate = Plates.GetComponent <PressurePlate>();

            if (!_plate.GetActivateInfo)
            {
                return(false);
            }
        }

        //if all plates is activated
        return(true);
    }
 public void StartAnimation()
 {
     if (place_metal_sheet == false)
     {
         place_metal_sheet         = true;
         Plates.transform.position = Positions.transform.position;
         Plates.transform.rotation = Positions.transform.rotation;
         Plates.GetComponent <Animator>().SetBool("place_metal_sheet", true);
     }
     else
     {
         place_metal_sheet = false;
         Plates.GetComponent <Animator>().SetBool("place_metal_sheet", false);
     }
 }
示例#7
0
        private void Update()
        {
            bool complete = true;

            Plates.ForEach((plate) =>
            {
                complete &= plate.Used;
            });

            if (complete && GameActive)
            {
                Debug.Log("Scene Complete");
                Ingredients.ForEach((ingredient) => ingredient.Active = false);
                GameActive = false;
                StartCoroutine(UI.EndGame());
            }
        }
示例#8
0
        public override void Add(ref RandomlyPlate plate)
        {
            if (heightColumn == 0)
            {
                plate.YOffset = CeilingOffsett - plate.Height;
                plate.XOffset = ColumnOffset - plate.Width;
                ColumnPlate.TransferCoordinates(ref plate);

                Plates.Add(plate);
                heightColumn += plate.Height;
                Fullness      = heightColumn / (double)WidthMainPlate;
            }
            else
            {
                var delta = Rapprochement(ref plate);
                heightColumn = (heightColumn + plate.Height - delta);
                Plates.Add(plate);
                Fullness = heightColumn / (double)WidthMainPlate;
            }
        }
示例#9
0
 private void AddPlate()
 {
     Plates.Add(new PlateCount(Texture.GetDefault(), 0, PlateChanged));
 }
示例#10
0
 public Solitaire()
 {
     plate_СhangeState = null;
     plates = new Plates();
     rnd = new Random();
 }
示例#11
0
 /// <summary>
 /// Перерисовывет все открытые плашки
 /// </summary>
 /// <param name="plates">Плашки</param>
 public void OpenAllDominoShow(Plates plates)
 {
     foreach (Plate plate in plates)
     {
         if (plate.state == State.Open)
         {
             DominoShow(plate);
         }
     }
 }
示例#12
0
 /// <summary>
 /// Перерисовывет все закрытые плашки
 /// </summary>
 /// <param name="plates">Плашки</param>
 public void HideAllDominoShow(Plates plates)
 {
     foreach(Plate plate in plates)
     {
         if(plate.state == State.Hide)
         {
             HideDominoShow(plate);
         }
     }
 }
示例#13
0
 public FoodSpawner(Plates plates, FoodLoader foodLoader, Node2D foodContainer)
 {
     _plates        = plates;
     _foodLoader    = foodLoader;
     _foodContainer = foodContainer;
 }
示例#14
0
        static async Task Main(string[] args)
        {
            var topicName = "Motion";

            var config = new ProducerConfig
            {
                BootstrapServers = "localhost:9092"
            };

            var schemaRegistryConfig = new SchemaRegistryConfig
            {
                Url = "localhost:8081"
            };

            var avroSerializerConfig = new AvroSerializerConfig
            {
                // optional Avro serializer properties:
                BufferBytes = 100
            };

            using (var schemaRegistry = new CachedSchemaRegistryClient(schemaRegistryConfig))
                using (var producer =
                           new ProducerBuilder <string, MotionEvent>(config)
                           .SetKeySerializer(new AvroSerializer <string>(schemaRegistry, avroSerializerConfig))
                           .SetValueSerializer(new AvroSerializer <MotionEvent>(schemaRegistry, avroSerializerConfig))
                           .Build())
                {
                    Console.WriteLine($"Starting producer {producer.Name} producing on {topicName} version {nameof(MotionEvent)}. Ctl-C to abort.");

                    var i = 0;
                    while (true)
                    {
                        var now         = DateTime.UtcNow;
                        var key         = $"2-{now.ToString("ddHHmmss")}";
                        var motionEvent = new MotionEvent {
                            id        = key,
                            timestamp = now,
                            camera    = "GUSTAV 2M",
                            plate     = Plates.GetPlate()
                        };

                        try
                        {
                            var deliveryReport = await producer.ProduceAsync(
                                topicName, new Message <string, MotionEvent>
                            {
                                Key   = key,
                                Value = motionEvent
                            });


                            Console.WriteLine($"Prod#2 id={motionEvent.id} cam={motionEvent.camera} plate={motionEvent.plate}");

                            i++;
                        }
                        catch (ProduceException <string, MotionEvent> e)
                        {
                            Console.WriteLine($"Failed to produce event {i} {e.Message} [{e.Error.Code}]");
                        }

                        await Task.Delay(1000);
                    }
                }
        }