示例#1
0
    public IEnumerator LobeID()
    {
        LobeGene[2] = 7;

        var InterpretedGene = LobeInterpreter.Interpret(LobeGene);

        Assert.AreEqual((BrainLobeID)7, InterpretedGene.LobeID);

        yield return(null);
    }
示例#2
0
    public IEnumerator LobeDimensions()
    {
        Vector2Int Dimension = new Vector2Int(3, 4);

        LobeGene[9]  = (byte)Dimension.x;
        LobeGene[10] = (byte)Dimension.y;

        var InterpretedGene = LobeInterpreter.Interpret(LobeGene);

        Assert.AreEqual(Dimension, InterpretedGene.Dimension);

        yield return(null);
    }
示例#3
0
    public IEnumerator LobeLocation()
    {
        Vector2Int Location = new Vector2Int(1, 2);

        LobeGene[7] = (byte)Location.x;
        LobeGene[8] = (byte)Location.y;

        var InterpretedGene = LobeInterpreter.Interpret(LobeGene);

        Assert.AreEqual(Location, InterpretedGene.Location);

        yield return(null);
    }
示例#4
0
    public static Gene InterpretGene(RawGene rawGene)
    {
        var GeneTypes = new
        {
            BrainLobe = new byte[] { 0x0, 0x0 }
        };

        byte[] GeneType = { rawGene[0], rawGene[1] };

        if (GeneType.SequenceEqual(GeneTypes.BrainLobe))
        {
            return(LobeInterpreter.Interpret(rawGene));
        }
        else
        {
            return(null);
        }
    }