本文整理汇总了C#中Sifteo.Cube类的典型用法代码示例。如果您正苦于以下问题:C# Cube类的具体用法?C# Cube怎么用?C# Cube使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cube类属于Sifteo命名空间,在下文中一共展示了Cube类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnButton
private void OnButton(Cube cube, bool pressed)
{
if (pressed) {
Sound sound = app.sounds[app.imageNames[app.wrappers[cube.UniqueId].index]];
sound.Play(1,0);
}
}
示例2: SiftOscCubeEvent
public SiftOscCubeEvent(Cube cube, OscClient client, IPEndPoint endPoint, List<SiftOscEventMessage> messages)
{
this.cube = cube;
this.client = client;
this.endPoint = endPoint;
this.messages = messages;
}
示例3: CubeWrapper
public CubeWrapper(MathScramble app, Cube cube, int seq)
{
mApp = app;
mCube = cube;
mCube.userData = this;
mSpriteIndex = 0;
//mRectColor = new Color (36, 182, 255);
//mSelectColor = new Color (255, 0, 0);
mRotation = 0;
mCube.TiltEvent += OnTilt;
mIndex = seq;
mCube.ButtonEvent += HandleCubeButtonEvent;
mCube.ShakeStartedEvent += HandleMCubeShakeStartedEvent;
//Init the State Machine
mRole = mApp.cubeStates [seq - 1];
InitStateMachine ();
//
mValue = mRole.GenerateValue ();
mColor = mRole.mColor;
mSize = mRole.mSize;
/*
if (mCubeStateMachine.Current == Constants.HintState) {
mNeedDraw = true;
Tick ();
}*/
//
}
示例4: CubeEventReporter
public CubeEventReporter(JsonTcpCommunication com, Cube c)
{
_com = com;
_c = c;
Reporters.Add (this);
ReportAllEvents ();
}
示例5: getFaderHelper
public static FaderHelper getFaderHelper(Cube c)
{
if (!_lookup.ContainsKey (c.UniqueId)) {
_lookup [c.UniqueId] = new FaderHelper (c);
}
return _lookup [c.UniqueId];
}
示例6: CubeWrapper
public CubeWrapper(EColiTest app, Cube cube)
{
mApp = app;
mCube = cube;
mCube.userData = this;
//Ensures that whatever color first appears on the cube is the color instance variable
if (mCubeType == 0)
{
if (mApp.mImageNames[colorIndex].Contains("red")) this.color = "red";
if (mApp.mImageNames[colorIndex].Contains("blue")) this.color = "blue";
if (mApp.mImageNames[colorIndex].Contains("yellow")) this.color = "yellow";
}
mApp.whitePlasmidController.mCube = this.mCube;
eColiColor = "white";
plasmidColor = "white";
//Adding the event handlers
mCube.ButtonEvent += OnButton;
mCube.TiltEvent += OnTilt;
mCube.FlipEvent += OnFlip;
}
示例7: OnTilt
private void OnTilt(Cube cube, Cube.Side direction)
{
switch (direction)
{
case Cube.Side.TOP:
cube.FillRect(new Color(0, 200, 0), 54, 54, 20, 20); // increasingly dark green
break;
case Cube.Side.BOTTOM:
cube.FillRect(new Color(0, 150, 0), 54, 54, 20, 20);
break;
case Cube.Side.LEFT:
cube.FillRect(new Color(0, 100, 0), 54, 54, 20, 20);
break;
case Cube.Side.RIGHT:
cube.FillRect(new Color(0, 50, 0), 54, 54, 20, 20);
break;
default:
cube.FillRect(Color.White, 54, 54, 20, 20); // extremely light green
break;
}
cube.Paint();
}
示例8: addPrimary
int addPrimary(Cube a, Cube b)
{
if (a.Neighbors.Right != null || a.Neighbors.Bottom != null)
AddCubeToArray (a,0);
else
AddCubeToArray(b,0);
return 0;
}
示例9: OnPress
private void OnPress(Cube cube, bool press)
{
if (!this.justPressed)
{
Console.WriteLine("Button pressed");
app.Answer(cube);
}
this.justPressed = !this.justPressed;
}
示例10: OperatorController
public OperatorController(Cube cube)
{
Log.Debug (classname + " Init");
mCube = cube;
mWrapper = (CubeWrapper)cube.userData;
mCube.NeighborAddEvent += OnNeighborAdd;
mCube.NeighborRemoveEvent += OnNeighborRemove;
}
示例11: NeighborAddNotification
private void NeighborAddNotification(Cube c, Cube.Side side, Cube neighbor, Cube.Side neighborSide)
{
Dictionary<String, Object> parameters = new Dictionary<String, Object> ();
String msg = "neighborAdded";
parameters.Add ("neighborId", neighbor.UniqueId);
parameters.Add ("cubeSide", side.ToString ());
parameters.Add ("neighborSide", neighborSide.ToString ());
this.NotifyEvent (msg, c, parameters);
}
示例12: StringPainter
/*
* Constructor with color and size
*/
public StringPainter(Cube cube, String label, System.Drawing.Color color, int size)
{
Log.Debug ("StringPainter {0}", label);
mCube = cube;
fontSize = size;
fontColor = color;
writeWord (label, mCube);
}
示例13: CubeWrapper
public CubeWrapper(SorterApp app, Cube cube, int seq)
{
mApp = app;
mCube = cube;
mCube.userData = this;
mSpriteIndex = 0;
mRectColor = new Color(36, 182, 255);
mIndex = seq;
}
示例14: StringPainter
/*
* Constructor with color and size
*/
public StringPainter(Cube cube, String label, System.Drawing.Color color, float size)
{
Log.Debug ("StringPainter {0}", label);
mCube = cube;
fontSize = size;
//fontColor = System.Drawing.Color.FromArgb (color.Data);
fontColor = color;
writeWord (label, mCube);
}
示例15: ButtonNotification
private void ButtonNotification(Cube c, bool isPressed)
{
String msg;
if (isPressed) {
msg = "pressed";
} else {
msg = "released";
}
this.NotifyEvent (msg, c);
}