using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
// Hashtable = sehr schnell ;)
var blendLut = new Dictionary<int, float>();
//
// 1 2 4
// 128 8
// 64 32 16
// RO+LU+RM = 4+64+8 = 76
// RO+LU+RM als blendIndex soll 28 sein
blendLut[76] = 28.0F;
// Analog für alle anderen kombinationen füllen
byte maske = 0;
int foo = 1;
// Ohne array da kein Bock zu initialisieren :D
if(0 == foo)
maske = 1;
maske |= 1 << 1;
if(1 == foo) // == Rechts oben
maske |= 1 << 2;
if(1 == foo) // == Rechts mitte
maske |= 1 << 3;
maske |= 1 << 4;
maske |= 1 << 5;
if(1 == foo) // == Links unten
maske |= 1 << 6;
maske |= 1 << 7;
Console.WriteLine(maske); // 76
float blendIndex = blendLut[maske];
Console.WriteLine(blendIndex); // 28
}