Exemplo n.º 1
0
        static void WriteCard(ProjectCard card)
        {
            string text;


            if (card.ContentUrl != null)
            {
                var cardURL = card.ContentUrl;
                var issueID = Int32.Parse(cardURL.Split('/').Last());
                var issue   = issuesClient.Get(repo.Id, issueID).Result;

                text = MakeLink(issue.Title, issue.Url);

                if (issue.State.Value == ItemState.Closed)
                {
                    text = MakeStrikethrough(text);
                }

                text = MakeItalic("#" + issueID) + " -- " + text;
            }
            else
            {
                text = card.Note;
            }


            writer.WriteLine(text);
            writer.WriteLine(writer.NewLine + "---" + writer.NewLine);
        }
Exemplo n.º 2
0
    public void TestTwoProjectCardsAreNotEqual1()
    {
        var         card = RM.RandomCard();
        ProjectCard pc1  = new ProjectCard(card, CardDice.II);
        ProjectCard pc2  = new ProjectCard(card, CardDice.I);

        Assert.IsFalse(pc1.IsEqualTo(pc2));
    }
Exemplo n.º 3
0
 public static string Stringify(this ProjectCard c)
 {
     return("" + (int)c.TakeProjectDice + CardSeparator +
            (int)c.Card.Class + CardSeparator +
            (int)c.Card.Dice + CardSeparator +
            c.Card.Number + CardSeparator +
            c.Card.TripleId);
 }
Exemplo n.º 4
0
    public void TestProjectCardParse()
    {
        var card1 = new Card(CardClass.ActionBank, CardDice.I, 6, 8);

        ProjectCard pc1 = new ProjectCard(card1, CardDice.II);
        ProjectCard pc2 = pc1.Stringify().ParseToProjectCard();

        Assert.IsTrue(pc1.IsEqualTo(pc2));
    }
Exemplo n.º 5
0
    public void TestTwoProjectCardsAreNotEqual2()
    {
        var         card1 = RM.RandomCard(3);
        var         card2 = RM.RandomCard(4);
        ProjectCard pc1   = new ProjectCard(card1, CardDice.II);
        ProjectCard pc2   = new ProjectCard(card2, CardDice.II);

        Assert.IsFalse(pc1.IsEqualTo(pc2));
    }
Exemplo n.º 6
0
    public void TestTwoProjectCardsAreNotEqual4()
    {
        var card1 = new Card(CardClass.ActionBank, CardDice.I, 6, 8);
        var card2 = new Card(CardClass.ActionBank, CardDice.I, 6, 9);

        ProjectCard pc1 = new ProjectCard(card1, CardDice.II);
        ProjectCard pc2 = new ProjectCard(card2, CardDice.II);

        Assert.IsFalse(pc1.IsEqualTo(pc2));
    }
 public void Activate(IStationModule module)
 {
     this.gameObject.SetActive(true);
     this.currentModule = module;
     this.title.text    = module.Name;
     foreach (Project availableProject in module.AvailableProjects())
     {
         ProjectCard card = cardFactory.CreateUnique(availableProject);
         card?.transform.SetParent(cardContainer, false);
     }
 }
Exemplo n.º 8
0
        void LoadLatest()
        {
            flpLatest.Controls.Clear();
            List <Project> latestProjects = IO.LatestProjects();
            ProjectCard    pc;

            foreach (Project p in latestProjects)
            {
                pc           = new ProjectCard(p);
                pc.Removable = true;
                pc.Click    += ProjectCard_Click;
                flpLatest.Controls.Add(pc);
            }
        }
Exemplo n.º 9
0
    public ProjectCard CreateUnique(Project project)
    {
        if (CardRegistry.ContainsKey(project) && CardRegistry[project] != null && !CardRegistry[project].Equals(null))
        {
            return(null);
        }

        ProjectCard card = Instantiate(cardTemplate);

        card.Init(project);

        CardRegistry[project] = card.gameObject;

        return(card);
    }
Exemplo n.º 10
0
    private void OnModelChanged()
    {
        if (viewChanging)
        {
            return;
        }
        // Rebuild view from model
        for (int i = projectContainer.transform.childCount - 1; i >= 0; i--)
        {
            cardFactory.DestroyCard(projectContainer.transform.GetChild(i).gameObject.GetComponent <ProjectCard>());
        }

        foreach (Project project in station.Station.Projects)
        {
            ProjectCard card = cardFactory.CreateUnique(project);
            card.transform.SetParent(projectContainer.transform, false);

            // this will reverse the order so that they go right-to-left
            card.transform.SetAsFirstSibling();
        }
    }
Exemplo n.º 11
0
    public static string Describe(this List <ProjectCard> list)
    {
        List <System.String> items = new List <System.String>();

        Repeat(6, () => items.Add("((" + (items.Count + 1) + ")): "));

        for (int i = 0; i < list.Count; i++)
        {
            ProjectCard obj = list[i];

            var pcString = obj.Card.Class + "[" + obj.Card.Dice + "], ";

            var row = getRowNumberByCardDice(obj.TakeProjectDice);
            items[row] = items[row] + pcString;
        }

        var output = "";

        items.ForEach((System.String obj) => { output += obj + "\n    "; });

        return(output);
    }
Exemplo n.º 12
0
    public static bool IsEqualTo(this List <ProjectCard> cards1, List <ProjectCard> cards2)
    {
        if (cards1.Count != cards2.Count)
        {
            return(false);
        }

        if (cards1 == null || cards2 == null)
        {
            throw new System.InvalidProgramException("Cannot compare nulls!");
        }

        for (int i = 0; i < cards1.Count; i++)
        {
            ProjectCard c1 = cards1[i];
            ProjectCard c2 = cards2[i];
            if (!c1.IsEqualTo(c2))
            {
                return(false);
            }
        }
        return(true);
    }
 public void OnCardRemoved(ProjectCard card)
 {
     onCardRemoved?.Invoke(card.Project);
 }
Exemplo n.º 14
0
 public void Post([FromBody] ProjectCard value)
 {
     _audit.Add($"Insert single card: {value.Id}");
 }
Exemplo n.º 15
0
 public static bool IsEqualTo(this ProjectCard card1, ProjectCard card2)
 {
     return(card1.Card.IsEqualTo(card2.Card) && card1.TakeProjectDice == card2.TakeProjectDice);
 }
Exemplo n.º 16
0
 public CardWrapper(ProjectColumn column, ProjectCard card)
 {
     Column = column;
     Card   = card;
     _uri   = new Uri(card.ContentUrl);
 }
Exemplo n.º 17
0
 private ProjectReleaseInformationPage AccessUnpublushedProject(ProjectCard UnpublishedProject)
 {
     return(new ProjectReleaseInformationPage(this._driver));
 }
Exemplo n.º 18
0
 public void DestroyCard(ProjectCard card)
 {
     CardRegistry.Remove(card.Project);
     Destroy(card.gameObject);
 }