Exemplo n.º 1
0
        public void refreshOutputs()
        {
            foreach (LogicGate l in logicGates)
            {
                l.reset();
            }

            bool mustRun = true;
            Connection[] firstCopy = new Connection[connections.Count];
            connections.CopyTo(firstCopy);
            List<Connection> workingCopy = firstCopy.ToList<Connection>();

            while (mustRun)
            {
                pushValuesForward(workingCopy);

                foreach (LogicGate l in logicGates)
                {
                    l.evaluate();
                }

            }

            //IDEIA GERAL
            //dar pushforward --- ok
            //processar as portas lógicas que derem
            // atualizar tabela de conexões, mudando valores para
            //parara
        }
Exemplo n.º 2
0
 public void connectTwoPoints(StatePoint A, StatePoint B)
 {
     Connection c = new Connection(A, B);
     connections.Add(c);
 }