Inheritance: MonoBehaviour
示例#1
0
        public async Task <IActionResult> AddPainting(PaintingViewModel paintingVM)
        {
            if (ModelState.IsValid)
            {
                Painting = new Painting(paintingVM);
                if (Painting.CurrentlyLocated != "Not on sale")
                {
                    Auction            = _auctions.FindAuctionByTitle(Painting.CurrentlyLocated);
                    Painting.AuctionId = Auction.Id;
                }

                Artist          = _artists.FindObject(Painting.ArtistId);
                Painting.Artist = Artist.FirstName + " " + Artist.LastName;

                Painting.ImgId = await _fileManager.SaveImage(paintingVM.Image);

                _paintings.AddObject(Painting);
                return(RedirectToAction("ArtistView", "Artists", new { @id = Painting.ArtistId }));
            }

            Auctions = _auctions.Auctions.FindAll(auc => (auc.EndDateTime - DateTime.Now).TotalSeconds >= 0)
                       .OrderBy(x => x.StartDateTime).ToList();
            ViewData["Auctions"] = Auctions;
            ViewBag.ArtistId     = paintingVM.ArtistId;
            return(View(paintingVM));
        }
示例#2
0
        public IHttpActionResult Put(int id, [FromBody] Painting painting)
        {
            logger.Write($"[PUT] (Paintings) /{id}", LogLevel.INFO);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != painting.Id)
            {
                return(BadRequest());
            }

            if (!PaintingExists(id))
            {
                return(NotFound());
            }

            if (db.Update(painting))
            {
                return(Ok());
            }

            return(InternalServerError());
        }
示例#3
0
        public int Add(Painting painting)
        {
            int id = dbContext.Paintings.Add(painting).Id;

            dbContext.SaveChanges();
            return(id);
        }
示例#4
0
        public void ThumbUp(Painting painting)
        {
            var result = Paintings.Where(x => x.id == painting.id).First();

            result.thumbsUp = painting.thumbsUp;
            Save();
        }
        public ActionResult Add(Painting painting)
        {
            _artCollection.Paintings.Add(painting);
            _artRepository.Save(_artCollection);

            return(RedirectToAction("Manage", "Paintings"));
        }
示例#6
0
        public IHttpActionResult PutPainting(int id, Painting painting)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != painting.PaintingId)
            {
                return(BadRequest());
            }

            db.Entry(painting).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PaintingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult Delete(int id, Painting painting)
        {
            _artCollection.Paintings.RemoveAt(id);
            _artRepository.Save(_artCollection);

            return(RedirectToAction("Manage", "Paintings"));
        }
示例#8
0
 void GotPicture()
 {
     carriedPainting = picController.GrabPicture();
     picSr.sprite    = carriedPainting.smSprite;
     picSr.enabled   = true;
     // TODO tell game object to set alarm
 }
示例#9
0
    private void CreateWall(MuseumCell cell, MuseumCell otherCell, CellDirection direction)
    {
        bool hasPainting = Random.value < paintingDensity;

        MuseumWall wall = Instantiate(wallPrefab) as MuseumWall;

        wall.Initialize(cell, otherCell, direction);
        if (otherCell != null)
        {
            wall = Instantiate(wallPrefab) as MuseumWall;
            wall.Initialize(otherCell, cell, direction.GetOpposite());
        }

        if (hasPainting)
        {
            Painting painting = Instantiate(paintingPrefab) as Painting;
            painting.Initialize(cell, direction);

            if (paintings.Length > 0)
            {
                string paintingName = paintings[(int)Random.Range(0, paintings.Length)];
                painting.LoadTexture(paintingName);
            }
        }
    }
示例#10
0
        public ActionResult Create([Bind(Include = "Id,Title,Desc,Height,Width,Price,Materials,Age,PaintingCatId,ArtistId,HMPublication")] Painting painting, HttpPostedFileBase upload)
        {
            if (ModelState.IsValid)
            {
                //sets the image path
                string imgName = Guid.NewGuid().ToString() + Path.GetExtension(upload.FileName);

                if (upload != null && upload.ContentLength > 0)
                {
                    var photo = new FilePath
                    {
                        FileName = imgName,
                        FileType = FileType.ItemPhoto
                    };
                    painting.FilePaths = new List <FilePath>();
                    painting.FilePaths.Add(photo);
                }
                //string imgPath = "images/" + imgName;
                var path = Path.Combine(Server.MapPath("~/images/"), imgName);
                //validates the posted file before saving
                if (upload != null && upload.FileName != "")
                {
                    //then save it to the Folder
                    upload.SaveAs(path);
                }
                db.Paintings.Add(painting);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ArtistId      = new SelectList(db.Artists, "Id", "Name", painting.ArtistId);
            ViewBag.PaintingCatId = new SelectList(db.PaintingCats, "Id", "Name", painting.PaintingCatId);
            return(View(painting));
        }
        internal string Delete(int id)
        {
            Painting data = GetById(id);

            _repo.Delete(id);
            return("delorted");
        }
示例#12
0
    public void ShowSketch()
    {
        GameObject currentSketchObj = Instantiate(sketchPrefabs[sketchNumber.value], pos, Quaternion.identity);

        currentSketch = currentSketchObj.GetComponent <Painting>();
        currentSketchObj.transform.SetParent(this.transform);
    }
示例#13
0
        static void Main(string[] args)
        {
            var html = System.IO.File.ReadAllText("sample.html");
            var css  = System.IO.File.ReadAllText("sample.css");

            var viewport = new Layout.Dimensions();

            viewport.Content.Width  = 800;
            viewport.Content.Height = 600;

            var rootNode   = Html.Parse(html);
            var stylesheet = Css.Parse(css);
            var styleRoot  = Style.StyleTree(rootNode, stylesheet);
            var layoutRoot = Layout.LayoutTree(styleRoot, viewport);

            var d = new Layout.Dimensions();

            d.Content.Width  = 800;
            d.Content.Height = 600;
            var canvas = Painting.Paint(layoutRoot, d.Content);

            var bitmap = new Bitmap(800, 600);

            for (int x = 0; x < canvas.Width; x++)
            {
                for (int y = 0; y < canvas.Height; y++)
                {
                    var px = canvas.Pixels[y * canvas.Width + x];
                    bitmap.SetPixel(x, y, Color.FromArgb(px.A, px.R, px.G, px.B));
                }
            }
            bitmap.Save("result.png");
        }
        // GET: PayPal/AddToCart/

        public ActionResult AddToCart(int PaintingID)
        {
            List <Item> CartList = Session["CartList"] as List <Item>;


            //Check if Session Was Empty
            if (CartList == null)
            {
                CartList = new List <Item>();
            }
            Painting painting = ServicePainting.GetPainting(PaintingID);
            Item     item     = new Item()
            {
                name        = painting.PaintingTitle.ToString(),
                currency    = "USD",
                price       = painting.Price.ToString(),
                quantity    = "1",
                sku         = "sku",
                description = painting.PaintingId.ToString()
            };

            AddOrUpdateCart(CartList, item);

            Session["CartList"] = CartList;
            return(View("Index", CartList));
        }
示例#15
0
 public void CleanPainting(Painting painting)
 {
     painting.Student.Avatar.Students          = new List <Student>();
     painting.Student.Avatar.Hair.Avatar       = new List <Avatar>();
     painting.Student.Avatar.Background.Avatar = new List <Avatar>();
     painting.Student.Classroom.Students       = new List <Student>();
 }
        public int Add(Painting painting)
        {
            db.Paintings.Add(painting);
            db.SaveChanges();

            return(painting.Id);
        }
 public DetailPageViewModel(INavigation navigation, Painting painting)
 {
     Navigation           = navigation;
     Painting             = painting;
     PopDetailPageCommand = new Command(async() => await ExecuteNavigateToDetailPageCommand());
     GetRating();
 }
示例#18
0
 public void UpdatePainting(Painting painting)
 {
     if (ValidatePainting(painting))
     {
         paintingRepository.UpdatePainting(painting);
     }
 }
示例#19
0
    public void SetNewPainting(Painting p)
    {
        PaintingManager.Instance.OnPaintingLoaded -= SetNewPainting;

        m_Material.mainTexture = p.Texture;
        transform.localScale   = new Vector3(p.Data.sizeX / 20f, transform.localScale.y, p.Data.sizeY / 20f);
    }
示例#20
0
        public int Add(Painting value)
        {
            var painting = db.Paintings.Add(value);

            db.SaveChanges();
            return(painting.Id);
        }
示例#21
0
        public ActionResult UpdatePainting(Painting painting, string[] colors)
        {
            try
            {
                List <Color> updatedColors = CreateColorList(colors);

                if (updatedColors.Any())
                {
                    painting.Colors = updatedColors;
                }

                paintingService.UpdatePainting(painting);

                return(RedirectToAction(nameof(AllPaintings)));
            }
            catch
            {
                List <Color> colorList      = colorService.GetAllColors();
                bool[]       selectedColors = painting.SelectedColors(colorList);

                ViewBag.itemList = CreateItemList(colorList, selectedColors);

                return(View(painting));
            }
        }
示例#22
0
    public void GetPainting()
    {
        Debug.Log("GetPainting() fired!");
        string         html    = string.Empty;
        string         url     = @"http://10.3.208.140:3001/api/getPaintings?name=" + currentText;
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

        request.AutomaticDecompression = DecompressionMethods.GZip;

        using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) using (StreamReader reader = new StreamReader(stream))
                {
                    html         = reader.ReadToEnd();
                    previousText = title.text;
                    Debug.Log(html);
                    Painting Paint = JsonUtility.FromJson <Painting>(html);
                    Debug.Log(Paint.paintingName);

                    currentText = previousText;
                    title.text  = Paint.paintingName;
                    author.text = Paint.artistName;
                    year.text   = Paint.created;
                    style.text  = Paint.period;

                    titleToSend  = Paint.paintingName;
                    authorToSend = Paint.artistName;
                    yearToSend   = Paint.created;
                    styleToSend  = Paint.period;
                    bioToSend    = Paint.bio;
                }
    }
        public IActionResult Edit(int id, [Bind("Id,Name,YearPainted,ImageURL,Painter")] Painting painting)
        {
            if (id != painting.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _paintingRepository.UpdatePainting(painting);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaintingExists(painting.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(painting));
        }
示例#24
0
    public static Painting FromFile(string fileData)
    {
        // Here we're using Linq to parse a file! Linq is a Functional way of
        // writing code that can be pretty great once you get used to it.
        // Linq should probably not be used in performance critical sections,
        // but it's acceptable enough for discrete events.
        //
        // In this file, each line is a paint stroke, and each point on that
        // stroke is separated by a comma. Each item within a point is
        // separated by spaces, which is taken care of in LinePointFromString.
        //
        // Example of a two stroke painting, two points in the first stroke
        // (white), and three points in the second stroke (red):
        // 0 0 0 255 255 255 0.01, 0.1 0 0 255 255 255 0.01
        // 0 0.1 0 255 0 0 0.02, 0.1 0.1 0 255 0 0 0.02, 0.2 0 0 255 0 0 0.02
        Painting result = new Painting();

        result._strokeList = fileData
                             .Split('\n')
                             .Select(textLine => textLine
                                     .Split(',')
                                     .Select(textPoint => LinePointFromString(textPoint))
                                     .ToArray())
                             .ToList();
        return(result);
    }
示例#25
0
 public Block(BlockType type, Painting painting, int x, int y, int z)
 {
     BlockType = type;
     Painting  = painting;
     X         = x;
     Y         = y;
     Z         = z;
 }
示例#26
0
        public ActionResult PaintingDetails()
        {
            paintingId     = Convert.ToInt32(TempData["id"]);
            TempData["id"] = paintingId;
            Painting painting = paintingService.GetPainting(paintingId, colorService);

            return(View(painting));
        }
示例#27
0
        public ActionResult DeleteConfirmed(int id)
        {
            Painting painting = db.Paintings.Find(id);

            db.Paintings.Remove(painting);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#28
0
 public void Add(Painting entity)
 {
     if (entity != null)
     {
         (this.unitOfWork.GetSet <Painting>()).AddOrUpdate(entity);
         unitOfWork.Commit();
     }
 }
示例#29
0
        // PUT: api/Paintings/5
        public void Put(int id, [FromBody] Painting value)
        {
            logger.Write("PUT for paintings with id " + id, LogLevel.INFO);

            value.Id = id;

            paintingsRepository.Update(value);
        }
示例#30
0
 public void TriggerExhibition()
 {
     inputEnabled = false;
     gameState    = GameState.Exhibition;
     fadePanel.gameObject.SetActive(true);
     fadePanel.DOFade(1, fadeSpeed).OnComplete(ResetPlayerPosition);
     Painting = null;
 }
示例#31
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     Painting ___test = new Painting();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
示例#32
0
    public void Link(Painting painting)
    {
        if (currentPainting != null) Unlink();
        gameObject.SetActive(true);
        currentPainting = painting;

        priceField.text = currentPainting.price.ToString();
        descriptiveText.text = "Name: " + currentPainting.title;
        Vector3 pos = Camera.main.WorldToScreenPoint(currentPainting.transform.position);
        GetComponent<RectTransform>().position = pos;
    }
示例#33
0
    void Start()
    {
        //Adding eventhandler to the 'ready' button.
        //Game manager
        if (Application.loadedLevelName == "Workspace_Yamil")
        {
            GameObject GUIManager = GameObject.Find("UIManager").gameObject;
            NavigateGUI navGUI = GUIManager.GetComponent<NavigateGUI>();
            Canvas rightCanvas = null;
            foreach (Canvas c in navGUI.Canvases) {
                if (c.name == "ResultCanvas")
                {
                    rightCanvas = c;
                }
            }
            //Screenshotmanager
            GameObject screenshotManger = GameObject.Find("ScreenShotManager").gameObject;
            ScreenshotOnly ssManager = screenshotManger.GetComponent<ScreenshotOnly>();
            //CurrentCanvas
            GameObject canvas = GameObject.Find("Canvas").gameObject;
            //Drawing Script
            DrawLinesTouch drawingScript = GameObject.Find("Main Camera Yamil").GetComponent<DrawLinesTouch>();
            //The done button
            GameObject buttonObj = GameObject.Find("Canvas/canvas options/canvas done/done").gameObject;
            Button button = buttonObj.GetComponent<Button>();
            button.onClick.AddListener(() => ssManager.MakeScreenshot());
            /*button.onClick.AddListener(() => canvas.SetActive(false));
            button.onClick.AddListener(() => navGUI.MoveTo(rightCanvas));*/
            //The back button
            buttonObj = GameObject.Find("Canvas/canvas options/canvas done/back").gameObject;
            button = buttonObj.GetComponent<Button>();
            button.onClick.AddListener(() => canvas.SetActive(false));
            button.onClick.AddListener(() => navGUI.MoveBack());
            button.onClick.AddListener(() => drawingScript.ClearLines());
            //The no button form the 'areyousurepopup'
            buttonObj = GameObject.Find("AreYouSurePopup/btnNo").gameObject;
            button = buttonObj.GetComponent<Button>();
            button.onClick.AddListener(() => canvas.SetActive(true));
        }
        if (Application.loadedLevelName == "Workspace_Laura")
        {
            GameObject GUIManager = GameObject.Find("UIManager").gameObject;
            NavigateGUI navGUI = GUIManager.GetComponent<NavigateGUI>();
            //
            GameObject canvas = GameObject.Find("Gallery").gameObject;
            //The back button
            GameObject buttonObj = GameObject.Find("Gallery/Done").gameObject;
            Button button = buttonObj.GetComponent<Button>();
            button.onClick.AddListener(() => canvas.SetActive(false));
            button.onClick.AddListener(() => navGUI.ReturnMainMenu());
        }

        Opdrachten = new List<Opdracht>();
        paintings = new List<Painting>();

        Screen.orientation = ScreenOrientation.Portrait;
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        /////////////////////////////////
        ////// ADD OPDRACHTEN HERE///////
        /////////////////////////////////

        //------------------------------------------------------------------------------------------------------------------------

        newInts = new List<int>();
        newInts.Add(6 + 5);
        newInts.Add(8 + 5);
        newInts.Add(10 + 5);
        newInts.Add(12 + 5);

        newColor.Add(Color.red);
        newColor.Add(Color.blue);
        newColor.Add(Color.yellow);
        newColor.Add (Color.green);

        Opdrachten.Add(new Opdracht("Maak van Donker Licht", "Rembrandt heeft dit schilderij erg donker getekend om het realistischer over te laten komen. Teken dit schilderij met lichte kleuren.", newInts, newBrush, newColor));

        //------------------------------------------------------------------------------------------------------------------------

        newInts.Clear();
        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(1 + 5);
        newInts.Add(4 + 5);
        newInts.Add(6 + 5);
        newInts.Add(9 + 5);
        newInts.Add(12 + 5);

        newBrush.Add(texture1);

        newColor.Add(Color.red);
        newColor.Add(Color.black);
        newColor.Add(Color.white);
        newColor.Add (Color.blue);
        newColor.Add (Color.green);

        Opdrachten.Add(new Opdracht("Teken symbolieken", "Volgens de geleerde heeft Rembrandt een aantal symbolieken toegevoegd aan dit schilderij. Een hiervan is “De uitgetrokken handschoen van de kapitein”.", newInts, newBrush, newColor));

        Painting nachtwacht = new Painting ("Nachtwacht", Opdrachten);
        paintings.Add (nachtwacht);

        //--------------------------------------------------------------------------------------------------------------------------------------------
        // new painting

        Opdrachten.Clear ();

        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);
        newBrush.Add(texture2);

        newColor.Add(Color.blue);
        newColor.Add(Color.red);
        newColor.Add(Color.yellow);
        newColor.Add(Color.green);

        Opdrachten.Add(new Opdracht("Emoties", "In dit kunstwerk worden de reacties van de apostelen weergegeven toen Jezus vertelde dat een van hen hem verraden zou hebben. De apostelen zijn in 4 groepjes verdeeld. Elke groep apostelen heeft een eigen emotie centraal staan. Neem 1 groepje en teken jouw interpretatie van hun reactie (emotie).", newInts, newBrush, newColor));

        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(4 + 5);

        newBrush.Add(texture1);
        newBrush.Add(texture2);
        newBrush.Add(texture3);

        newColor.Add(Color.black);
        newColor.Add(Color.white);
        newColor.Add(Color.gray);

        Opdrachten.Add(new Opdracht("Tekentechniek: Clair-Obscur", "Da Vinci heeft 2 verschillende technieken ontworpen. Een hiervan heet: “Clair-Obscur”\nDit is een techniek waarbij de vorm gesuggereerd wordt door het gebruik van licht en donker. Deze contrasten tussen licht en donker worden sterker weergegeven dan ze in werkelijkheid zijn. Hierbij worden de objecten op de achtergrond donker te kleuren en objecten op de voorgrond licht.  Dit is een hulpmiddel om werk realistisch te laten lijken.\nProbeer met behulp van deze techniek dit schilderij na te maken.", newInts, newBrush, newColor));

        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(4 + 5);
        newInts.Add(6 + 5);

        newBrush.Add(texture1);

        newColor.Add(Color.red);
        newColor.Add(Color.blue);
        newColor.Add(Color.yellow);

        Opdrachten.Add(new Opdracht("Portret", "De meeste schilderijen rond deze tijd waren portret schilderijen. Doordat Da Vinci hier geen portret heeft geschilderd, maar juist een groep mensen, maakt dit zo bijzonder voor deze tijd. Neem één persoon uit dit schilderij en teken van deze persoon een portret.\n", newInts, newBrush, newColor));

        Painting avondmaal = new Painting ("Het Laatste Avondmaal", Opdrachten);
        paintings.Add(avondmaal);

        //--------------------------------------------------------------------------------------------------------------------------------------------
        // new painting

        Opdrachten.Clear ();

        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(1 + 5);
        newInts.Add(4 + 5);
        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);
        newBrush.Add(texture2);

        newColor.Add(Color.yellow);
        newColor.Add(Color.blue);
        newColor.Add(Color.red);

        Opdrachten.Add(new Opdracht("Ochtend naar middag", "Het schilderij is geschilderd net voordat de zon op komt. Maar hoe zou dit schilderij er uit zien als het in de middag werd geschilderd? Misschien is alles wel scherper aangezien het niet meer schemer", newInts, newBrush, newColor));

        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(4 + 5);
        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);

        newColor.Add(Color.blue);
        newColor.Add(Color.yellow);
        newColor.Add(Color.black);
        newColor.Add(Color.white);
        newColor.Add(Color.cyan);

        Opdrachten.Add(new Opdracht("Van verf naar potlood", "Van Gogh maakte dit schilderij met alleen olie verf.\nzorg er voor dat je die schilderij zo goed mogelijk natekenend met alleen potlood.", newInts, newBrush, newColor));

        newInts = new List<int>();
        newBrush = new List<Texture> ();
        newColor = new List<Color> ();

        newInts.Add(4 + 5);
        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);

        newColor.Add(Color.yellow);
        newColor.Add(Color.red);
        newColor.Add(Color.blue);
        newColor.Add(Color.cyan);
        newColor.Add(Color.black);
        newColor.Add(Color.white);

        Opdrachten.Add(new Opdracht("Tekenen met bogen", "In dit schilderij is het gebruik van bogen erg belangrijk. Probeer nu zelf dit schilderij na te tekenen zonder het gebruik van rechte lijnen.", newInts, newBrush, newColor));

        Painting sterrennacht = new Painting ("Sterrennacht", Opdrachten);
        paintings.Add(sterrennacht);

        //--------------------------------------------------------------------------------------------------------------------------------------------
        // new painting

        Opdrachten.Clear();

        newInts = new List<int>();
        newBrush = new List<Texture>();
        newColor = new List<Color>();

        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);
        newBrush.Add(texture2);

        newColor.Add(Color.yellow);
        newColor.Add(Color.blue);
        newColor.Add(Color.red);
        newColor.Add(Color.white);

        Opdrachten.Add(new Opdracht("Stratenpatroon", "De inspiratie van dit schilderij kwam van het stratenpatroon in New York en van de swingende jazzmuziek van die tijd. Teken jouw stratenpatroon waar je woont met de verkregen inspiratie.", newInts, newBrush, newColor));

        newInts = new List<int>();
        newBrush = new List<Texture>();
        newColor = new List<Color>();

        newInts.Add(4 + 5);
        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);
        newBrush.Add(texture2);
        newBrush.Add(texture3);
        newBrush.Add(texture4);
        newBrush.Add(texture5);

        newColor.Add(Color.yellow);

        Opdrachten.Add(new Opdracht("Sfeerimpressie", "Mondriaan tekende met primaire kleuren en abstracte vormen. Maak een eigen sfeerimpressie waarbij iedere kleur een andere richting weergeeft.(Horizontaal/Verticaal/Diagonaal)", newInts, newBrush, newColor));

        newInts = new List<int>();
        newBrush = new List<Texture>();
        newColor = new List<Color>();

        newInts.Add(4 + 5);
        newInts.Add(6 + 5);
        newInts.Add(9 + 5);

        newBrush.Add(texture1);

        newColor.Add(Color.yellow);
        newColor.Add(Color.red);
        newColor.Add(Color.blue);

        Opdrachten.Add(new Opdracht("Hobbyist", "Mondriaan is een schilder die vooral abstracte kunstwerken maakt. Ook dit is weer een abstract kunstwerk. Teken je hobby met de kleuren die ook in dit kunstwerk verwerkt zijn.", newInts, newBrush, newColor));

        Painting boogie = new Painting("Broadway Boogie Woogie", Opdrachten);
        paintings.Add(boogie);

        SetOpdracht(Opdrachten[0]);
    }
示例#34
0
    private Evaluation IsWorthPurchasing(Painting painting)
    {
        Evaluation ev = Evaluation.WORTH;

        if (spendingLeeway < (painting.price - painting.truePrice)) ev |= Evaluation.OUTSIDE_PRICE_LEEWAY;
        if (priceRangeMax < painting.price || painting.price < priceRangeMin) ev |= Evaluation.OUTSIDE_PRICE_RANGE;
        if (painting.nameFactor < minNameFactor) ev |= Evaluation.BELOW_NAMEFAC_REQ;
        if (player.fame < minFame) ev |= Evaluation.BELOW_FAME_REQ;
        if (painting.timeSpent < minPaintingTime) ev |= Evaluation.BELOW_TIME_REQ;

        return ev;
    }
示例#35
0
    private IEnumerator ExaminePainting(Painting painting)
    {
        Evaluation ev = IsWorthPurchasing(painting);
        List<Evaluation> indicies = new List<Evaluation>();
        for (int i = 1; i <= 5; i++)
        {
            Evaluation e = (Evaluation)(1 << i);
            if ((ev & e) == e)
            {
                indicies.Add(e);
            }
        }

        if (indicies.Count > 0)
        {
            Evaluation eval = indicies[Random.Range(0, indicies.Count)];
            switch (eval)
            {
                case Evaluation.BELOW_FAME_REQ:
                    dialog.vBubble[0].vMessage = RandomLine(belowFameResponses);
                    dialog.ShowBubble();
                    yield return new WaitForSeconds(4.2f);

                    break;
                case Evaluation.BELOW_NAMEFAC_REQ:
                    dialog.vBubble[0].vMessage = RandomLine(belowNameFactorResponses);
                    dialog.ShowBubble();
                    yield return new WaitForSeconds(4.2f);
                    break;
                case Evaluation.BELOW_TIME_REQ:
                    dialog.vBubble[0].vMessage = RandomLine(belowTimespentResponses);
                    dialog.ShowBubble();
                    yield return new WaitForSeconds(4.2f);
                    break;
                case Evaluation.OUTSIDE_PRICE_LEEWAY:
                    dialog.vBubble[0].vMessage = RandomLine(outsideLeewayResponses);
                    dialog.ShowBubble();
                    yield return new WaitForSeconds(4.2f);
                    break;
                case Evaluation.OUTSIDE_PRICE_RANGE:
                    dialog.vBubble[0].vMessage = RandomLine(outsidePricerangeResponses);
                    dialog.ShowBubble();
                    yield return new WaitForSeconds(4.2f);
                    break;
                default:
                    Debug.LogError("Evaluation type unknown: " + eval.ToString());
                    Debug.Break();
                    break;
            }
        }
        else
        {
            dialog.vBubble[0].vMessage = RandomLine(buyResponses);
            dialog.ShowBubble();
            GetComponentInChildren<Animator>().SetTrigger("Happy");
            SendMessageUpwards("PurchasePainting", painting);
            PlayWow();
            yield return new WaitForSeconds(5.2f);

        }
        Destroy(dialog.GetComponentInChildren<Appear>().gameObject);

        /*switch(ev) {
            case Evaluation.SHIT:
                dialog.vBubble[0].vMessage = RandomLine(shitResponses);
                dialog.ShowBubble();
                PlayPonder ();
                yield return new WaitForSeconds(4.5f);
                break;
            case Evaluation.AFFORDABLE:
                dialog.vBubble[0].vMessage = RandomLine(notMyTasteResponses);
                dialog.ShowBubble();
                PlayPonder ();
                yield return new WaitForSeconds(4.5f);
                break;
            case Evaluation.MY_TASTE:
                dialog.vBubble[0].vMessage = RandomLine(noAffordResponses);
                dialog.ShowBubble();
                PlayPonder ();
                yield return new WaitForSeconds(4.5f);
                break;
            case Evaluation.BOTH:
                dialog.vBubble[0].vMessage = RandomLine(buyResponses);
                dialog.ShowBubble();
                PlayWow();
                SendMessageUpwards("PurchasePainting", painting);
                yield return new WaitForSeconds(4.2f);
                break;
        }*/
    }
示例#36
0
 public void Unlink()
 {
     currentPainting = null;
     gameObject.SetActive(false);
 }
示例#37
0
 public void RemoveFromSplats(Painting painting)
 {
     if (isDead || isLocked) return;
     if (!splatsUnderPlayer.Contains(painting)) return;
     splatsUnderPlayer.Remove(painting);
     if (splatsUnderPlayer.Count == 0) {
         drainGroup = null;
         return;
     }
     bool isStillInSameSplatGroup = false;
     foreach (Painting p in splatsUnderPlayer) {
         if (p.splatGroup == drainGroup) {
             isStillInSameSplatGroup = true;
             break;
         }
     }
     if (!isStillInSameSplatGroup) {
         drainGroup = splatsUnderPlayer[0].splatGroup;
     }
 }
示例#38
0
 public void AddToSplats(Painting painting)
 {
     if (isDead || isLocked) return;
     if (splatsUnderPlayer.Contains(painting)) return;
     splatsUnderPlayer.Add(painting);
     if (drainGroup == null) {
         drainGroup = painting.splatGroup;
     }
 }